@photivra/engine 1.4.0 → 2.0.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 +401 -6
- package/CITATION.cff +1 -1
- package/NODE_SUPPORT.md +64 -12
- package/README.md +301 -182
- package/SECURITY.md +37 -28
- package/THIRD_PARTY.md +148 -4
- package/dist/camera/equivalent-focal-length.d.ts +13 -14
- package/dist/camera/equivalent-focal-length.js +15 -13
- package/dist/camera/equivalent-focal-length.js.map +1 -1
- package/dist/camera/field-of-view.d.ts +30 -19
- package/dist/camera/field-of-view.js +67 -18
- package/dist/camera/field-of-view.js.map +1 -1
- package/dist/camera/lens-projection.d.ts +170 -0
- package/dist/camera/lens-projection.js +444 -0
- package/dist/camera/lens-projection.js.map +1 -0
- package/dist/camera/projected-object-size.d.ts +10 -11
- package/dist/camera/projected-object-size.js +12 -10
- package/dist/camera/projected-object-size.js.map +1 -1
- package/dist/capture/capture-export-metadata.d.ts +9 -10
- package/dist/capture/capture-export-metadata.js +8 -5
- package/dist/capture/capture-export-metadata.js.map +1 -1
- package/dist/capture/dng-import.d.ts +91 -0
- package/dist/capture/dng-import.js +343 -0
- package/dist/capture/dng-import.js.map +1 -0
- package/dist/capture/environment-raw-producer.d.ts +37 -17
- package/dist/capture/environment-raw-producer.js +43 -19
- package/dist/capture/environment-raw-producer.js.map +1 -1
- package/dist/capture/export-jpeg.d.ts +35 -4
- package/dist/capture/export-jpeg.js +133 -47
- package/dist/capture/export-jpeg.js.map +1 -1
- package/dist/capture/export-tiff.d.ts +48 -24
- package/dist/capture/export-tiff.js +91 -31
- package/dist/capture/export-tiff.js.map +1 -1
- package/dist/capture/focus-control.d.ts +42 -65
- package/dist/capture/focus-control.js +56 -75
- package/dist/capture/focus-control.js.map +1 -1
- package/dist/capture/host-yield-cadence.d.ts +25 -0
- package/dist/capture/host-yield-cadence.js +25 -0
- package/dist/capture/host-yield-cadence.js.map +1 -0
- package/dist/capture/linear-encoding.d.ts +14 -12
- package/dist/capture/linear-encoding.js +14 -13
- package/dist/capture/linear-encoding.js.map +1 -1
- package/dist/capture/lossless-jpeg.d.ts +27 -0
- package/dist/capture/lossless-jpeg.js +237 -0
- package/dist/capture/lossless-jpeg.js.map +1 -0
- package/dist/capture/native-environment-lean.d.ts +227 -0
- package/dist/capture/native-environment-lean.js +974 -0
- package/dist/capture/native-environment-lean.js.map +1 -0
- package/dist/capture/native-environment-optical-stage.d.ts +97 -0
- package/dist/capture/native-environment-optical-stage.js +340 -0
- package/dist/capture/native-environment-optical-stage.js.map +1 -0
- package/dist/capture/native-environment-raw.d.ts +140 -6
- package/dist/capture/native-environment-raw.js +435 -34
- package/dist/capture/native-environment-raw.js.map +1 -1
- package/dist/capture/native-raw-development.d.ts +118 -5
- package/dist/capture/native-raw-development.js +224 -59
- package/dist/capture/native-raw-development.js.map +1 -1
- package/dist/capture/native-raw-dng.d.ts +60 -0
- package/dist/capture/native-raw-dng.js +167 -0
- package/dist/capture/native-raw-dng.js.map +1 -0
- package/dist/capture/native-raw.d.ts +67 -10
- package/dist/capture/native-raw.js +90 -24
- package/dist/capture/native-raw.js.map +1 -1
- package/dist/capture/packed-sensor-raw.d.ts +160 -0
- package/dist/capture/packed-sensor-raw.js +221 -0
- package/dist/capture/packed-sensor-raw.js.map +1 -0
- package/dist/capture/photographic-export.d.ts +58 -35
- package/dist/capture/photographic-export.js +177 -70
- package/dist/capture/photographic-export.js.map +1 -1
- package/dist/capture/raw-development-kernel.d.ts +52 -0
- package/dist/capture/raw-development-kernel.js +88 -0
- package/dist/capture/raw-development-kernel.js.map +1 -0
- package/dist/capture/raw-frame-limits.d.ts +7 -7
- package/dist/capture/raw-frame-limits.js +7 -6
- package/dist/capture/raw-frame-limits.js.map +1 -1
- package/dist/capture/raw-frame-reconstruction.d.ts +8 -9
- package/dist/capture/raw-frame-reconstruction.js +9 -8
- package/dist/capture/raw-frame-reconstruction.js.map +1 -1
- package/dist/capture/raw-white-level.d.ts +55 -0
- package/dist/capture/raw-white-level.js +165 -0
- package/dist/capture/raw-white-level.js.map +1 -0
- package/dist/capture/release-sequence.d.ts +5 -7
- package/dist/capture/release-sequence.js +15 -13
- package/dist/capture/release-sequence.js.map +1 -1
- package/dist/capture/sensor-raw-frame.d.ts +5 -6
- package/dist/capture/sensor-raw-frame.js +26 -9
- package/dist/capture/sensor-raw-frame.js.map +1 -1
- package/dist/capture/sensor-raw-producer.d.ts +21 -13
- package/dist/capture/sensor-raw-producer.js +86 -25
- package/dist/capture/sensor-raw-producer.js.map +1 -1
- package/dist/capture/simulated-capture.d.ts +15 -16
- package/dist/capture/simulated-capture.js +22 -12
- package/dist/capture/simulated-capture.js.map +1 -1
- package/dist/color/camera-color-matrix.d.ts +69 -0
- package/dist/color/camera-color-matrix.js +132 -0
- package/dist/color/camera-color-matrix.js.map +1 -0
- package/dist/color/capture-color.d.ts +17 -10
- package/dist/color/capture-color.js +50 -17
- package/dist/color/capture-color.js.map +1 -1
- package/dist/color/chromatic-adaptation.d.ts +63 -0
- package/dist/color/chromatic-adaptation.js +91 -0
- package/dist/color/chromatic-adaptation.js.map +1 -0
- package/dist/color/color-difference.d.ts +104 -0
- package/dist/color/color-difference.js +205 -0
- package/dist/color/color-difference.js.map +1 -0
- package/dist/color/color-matching-functions.d.ts +168 -0
- package/dist/color/color-matching-functions.js +309 -0
- package/dist/color/color-matching-functions.js.map +1 -0
- package/dist/color/colorimetry-math.d.ts +52 -0
- package/dist/color/colorimetry-math.js +144 -0
- package/dist/color/colorimetry-math.js.map +1 -0
- package/dist/color/gamut-mapping.d.ts +54 -0
- package/dist/color/gamut-mapping.js +107 -0
- package/dist/color/gamut-mapping.js.map +1 -0
- package/dist/color/illuminants.d.ts +182 -0
- package/dist/color/illuminants.js +434 -0
- package/dist/color/illuminants.js.map +1 -0
- package/dist/color/rgb-color-spaces.d.ts +79 -0
- package/dist/color/rgb-color-spaces.js +115 -0
- package/dist/color/rgb-color-spaces.js.map +1 -0
- package/dist/color/sensor-color-development.d.ts +33 -11
- package/dist/color/sensor-color-development.js +104 -30
- package/dist/color/sensor-color-development.js.map +1 -1
- package/dist/color/srgb-icc.d.ts +9 -2
- package/dist/color/srgb-icc.js +16 -5
- package/dist/color/srgb-icc.js.map +1 -1
- package/dist/color/srgb-transfer.d.ts +1 -2
- package/dist/color/srgb-transfer.js +1 -1
- package/dist/color/srgb-transfer.js.map +1 -1
- package/dist/color/white-balance.d.ts +68 -19
- package/dist/color/white-balance.js +168 -35
- package/dist/color/white-balance.js.map +1 -1
- package/dist/composition/image-formation-plan.d.ts +152 -128
- package/dist/composition/image-formation-plan.js +292 -138
- package/dist/composition/image-formation-plan.js.map +1 -1
- package/dist/composition/plan-consumer.d.ts +6 -7
- package/dist/composition/plan-consumer.js +14 -11
- package/dist/composition/plan-consumer.js.map +1 -1
- package/dist/core/calculation-result.d.ts +21 -14
- package/dist/core/calculation-result.js +209 -11
- package/dist/core/calculation-result.js.map +1 -1
- package/dist/core/canonical-json.d.ts +13 -8
- package/dist/core/canonical-json.js +34 -15
- package/dist/core/canonical-json.js.map +1 -1
- package/dist/core/configuration-error.d.ts +5 -4
- package/dist/core/configuration-error.js +5 -3
- package/dist/core/configuration-error.js.map +1 -1
- package/dist/core/evidence-provenance.d.ts +12 -12
- package/dist/core/evidence-provenance.js +10 -9
- package/dist/core/evidence-provenance.js.map +1 -1
- package/dist/core/image-formation.d.ts +11 -10
- package/dist/core/image-formation.js +11 -9
- package/dist/core/image-formation.js.map +1 -1
- package/dist/core/owned-data.d.ts +9 -17
- package/dist/core/owned-data.js +9 -16
- package/dist/core/owned-data.js.map +1 -1
- package/dist/core/portable-math.d.ts +15 -0
- package/dist/core/portable-math.js +56 -0
- package/dist/core/portable-math.js.map +1 -0
- package/dist/core/record-validation.d.ts +48 -9
- package/dist/core/record-validation.js +93 -19
- package/dist/core/record-validation.js.map +1 -1
- package/dist/core/scientific-assurance.d.ts +16 -14
- package/dist/core/scientific-assurance.js +22 -18
- package/dist/core/scientific-assurance.js.map +1 -1
- package/dist/core/spectral-composition.d.ts +13 -14
- package/dist/core/spectral-composition.js +30 -27
- package/dist/core/spectral-composition.js.map +1 -1
- package/dist/core/spectral.d.ts +5 -6
- package/dist/core/spectral.js +9 -7
- package/dist/core/spectral.js.map +1 -1
- package/dist/core/validation.d.ts +3 -6
- package/dist/core/validation.js +3 -5
- package/dist/core/validation.js.map +1 -1
- package/dist/core/version.d.ts +6 -6
- package/dist/core/version.js +6 -5
- package/dist/core/version.js.map +1 -1
- package/dist/equipment/exposure-capabilities.d.ts +10 -10
- package/dist/equipment/exposure-capabilities.js +40 -30
- package/dist/equipment/exposure-capabilities.js.map +1 -1
- package/dist/equipment/generic-tier-assets.d.ts +13 -6
- package/dist/equipment/generic-tier-assets.js +34 -15
- package/dist/equipment/generic-tier-assets.js.map +1 -1
- package/dist/equipment/generic-tier-presets.d.ts +5 -6
- package/dist/equipment/generic-tier-presets.js +15 -13
- package/dist/equipment/generic-tier-presets.js.map +1 -1
- package/dist/equipment/iso-capabilities.d.ts +21 -22
- package/dist/equipment/iso-capabilities.js +49 -44
- package/dist/equipment/iso-capabilities.js.map +1 -1
- package/dist/equipment/metering-capabilities.d.ts +5 -6
- package/dist/equipment/metering-capabilities.js +22 -19
- package/dist/equipment/metering-capabilities.js.map +1 -1
- package/dist/equipment/release-capabilities.d.ts +3 -4
- package/dist/equipment/release-capabilities.js +18 -14
- package/dist/equipment/release-capabilities.js.map +1 -1
- package/dist/exposure/exposure-duration-control.d.ts +19 -17
- package/dist/exposure/exposure-duration-control.js +27 -23
- package/dist/exposure/exposure-duration-control.js.map +1 -1
- package/dist/exposure/exposure-mode-resolver.d.ts +42 -39
- package/dist/exposure/exposure-mode-resolver.js +127 -82
- package/dist/exposure/exposure-mode-resolver.js.map +1 -1
- package/dist/exposure/exposure.d.ts +17 -16
- package/dist/exposure/exposure.js +22 -15
- package/dist/exposure/exposure.js.map +1 -1
- package/dist/exposure/flash-ttl.d.ts +135 -0
- package/dist/exposure/flash-ttl.js +193 -0
- package/dist/exposure/flash-ttl.js.map +1 -0
- package/dist/exposure/flash.d.ts +144 -36
- package/dist/exposure/flash.js +259 -59
- package/dist/exposure/flash.js.map +1 -1
- package/dist/exposure/metering-scene-radiance.d.ts +10 -10
- package/dist/exposure/metering-scene-radiance.js +42 -23
- package/dist/exposure/metering-scene-radiance.js.map +1 -1
- package/dist/exposure/metering-target.d.ts +8 -8
- package/dist/exposure/metering-target.js +30 -20
- package/dist/exposure/metering-target.js.map +1 -1
- package/dist/exposure/metering-temporal.d.ts +16 -15
- package/dist/exposure/metering-temporal.js +41 -19
- package/dist/exposure/metering-temporal.js.map +1 -1
- package/dist/exposure/metering.d.ts +64 -17
- package/dist/exposure/metering.js +159 -30
- package/dist/exposure/metering.js.map +1 -1
- package/dist/exposure/program-line.d.ts +5 -5
- package/dist/exposure/program-line.js +20 -13
- package/dist/exposure/program-line.js.map +1 -1
- package/dist/facade/camera-preset.d.ts +8 -0
- package/dist/facade/camera-preset.js +102 -0
- package/dist/facade/camera-preset.js.map +1 -0
- package/dist/facade/chart-radiance-batch.d.ts +57 -0
- package/dist/facade/chart-radiance-batch.js +121 -0
- package/dist/facade/chart-radiance-batch.js.map +1 -0
- package/dist/facade/chart-scenes.d.ts +177 -0
- package/dist/facade/chart-scenes.js +232 -0
- package/dist/facade/chart-scenes.js.map +1 -0
- package/dist/facade/host-yield.d.ts +7 -0
- package/dist/facade/host-yield.js +23 -0
- package/dist/facade/host-yield.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +117 -0
- package/dist/facade/scene-radiance.js +205 -0
- package/dist/facade/scene-radiance.js.map +1 -0
- package/dist/facade/simulate-capture.d.ts +284 -0
- package/dist/facade/simulate-capture.js +1026 -0
- package/dist/facade/simulate-capture.js.map +1 -0
- package/dist/gpu/chart-radiance-gpu.d.ts +17 -0
- package/dist/gpu/chart-radiance-gpu.js +176 -0
- package/dist/gpu/chart-radiance-gpu.js.map +1 -0
- package/dist/gpu/image-kernel-accelerator.d.ts +132 -0
- package/dist/gpu/image-kernel-accelerator.js +720 -0
- package/dist/gpu/image-kernel-accelerator.js.map +1 -0
- package/dist/gpu/image-kernel-execution.d.ts +92 -0
- package/dist/gpu/image-kernel-execution.js +84 -0
- package/dist/gpu/image-kernel-execution.js.map +1 -0
- package/dist/gpu/sensor-stage-gpu.d.ts +44 -0
- package/dist/gpu/sensor-stage-gpu.js +317 -0
- package/dist/gpu/sensor-stage-gpu.js.map +1 -0
- package/dist/gpu/temporal-sum-gpu.d.ts +23 -0
- package/dist/gpu/temporal-sum-gpu.js +150 -0
- package/dist/gpu/temporal-sum-gpu.js.map +1 -0
- package/dist/gpu/webgpu-runtime.d.ts +63 -0
- package/dist/gpu/webgpu-runtime.js +215 -0
- package/dist/gpu/webgpu-runtime.js.map +1 -0
- package/dist/gpu/wgsl-chart-kernel.d.ts +30 -0
- package/dist/gpu/wgsl-chart-kernel.js +165 -0
- package/dist/gpu/wgsl-chart-kernel.js.map +1 -0
- package/dist/gpu/wgsl-kernels.d.ts +53 -0
- package/dist/gpu/wgsl-kernels.js +365 -0
- package/dist/gpu/wgsl-kernels.js.map +1 -0
- package/dist/gpu/wgsl-sensor-kernel.d.ts +64 -0
- package/dist/gpu/wgsl-sensor-kernel.js +409 -0
- package/dist/gpu/wgsl-sensor-kernel.js.map +1 -0
- package/dist/index.d.ts +89 -25
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/dist/motion/camera-rotation.d.ts +92 -40
- package/dist/motion/camera-rotation.js +84 -47
- package/dist/motion/camera-rotation.js.map +1 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts +37 -34
- package/dist/motion/capture-rotation-inverse-mapping.js +32 -24
- package/dist/motion/capture-rotation-inverse-mapping.js.map +1 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts +39 -35
- package/dist/motion/capture-rotation-temporal-quadrature.js +37 -28
- package/dist/motion/capture-rotation-temporal-quadrature.js.map +1 -1
- package/dist/motion/capture-rotation-trajectory.d.ts +32 -28
- package/dist/motion/capture-rotation-trajectory.js +36 -26
- package/dist/motion/capture-rotation-trajectory.js.map +1 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts +23 -21
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js +33 -14
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js.map +1 -1
- package/dist/motion/extended-object-projection.d.ts +19 -16
- package/dist/motion/extended-object-projection.js +38 -18
- package/dist/motion/extended-object-projection.js.map +1 -1
- package/dist/motion/projected-motion.d.ts +18 -17
- package/dist/motion/projected-motion.js +25 -17
- package/dist/motion/projected-motion.js.map +1 -1
- package/dist/motion/temporal-exposure-sum.d.ts +55 -0
- package/dist/motion/temporal-exposure-sum.js +141 -0
- package/dist/motion/temporal-exposure-sum.js.map +1 -0
- package/dist/motion/video-sequence.d.ts +111 -0
- package/dist/motion/video-sequence.js +179 -0
- package/dist/motion/video-sequence.js.map +1 -0
- package/dist/optics/aperture.d.ts +14 -15
- package/dist/optics/aperture.js +13 -11
- package/dist/optics/aperture.js.map +1 -1
- package/dist/optics/atmospheric-haze.d.ts +83 -0
- package/dist/optics/atmospheric-haze.js +113 -0
- package/dist/optics/atmospheric-haze.js.map +1 -0
- package/dist/optics/brown-conrady-distortion.d.ts +116 -0
- package/dist/optics/brown-conrady-distortion.js +291 -0
- package/dist/optics/brown-conrady-distortion.js.map +1 -0
- package/dist/optics/circle-of-confusion.d.ts +10 -10
- package/dist/optics/circle-of-confusion.js +15 -11
- package/dist/optics/circle-of-confusion.js.map +1 -1
- package/dist/optics/complex-pupil-psf.d.ts +64 -33
- package/dist/optics/complex-pupil-psf.js +190 -98
- package/dist/optics/complex-pupil-psf.js.map +1 -1
- package/dist/optics/depth-of-field.d.ts +25 -15
- package/dist/optics/depth-of-field.js +67 -27
- package/dist/optics/depth-of-field.js.map +1 -1
- package/dist/optics/diffraction.d.ts +14 -13
- package/dist/optics/diffraction.js +14 -10
- package/dist/optics/diffraction.js.map +1 -1
- package/dist/optics/focus-breathing.d.ts +88 -27
- package/dist/optics/focus-breathing.js +114 -23
- package/dist/optics/focus-breathing.js.map +1 -1
- package/dist/optics/focus-state.d.ts +18 -18
- package/dist/optics/focus-state.js +21 -15
- package/dist/optics/focus-state.js.map +1 -1
- package/dist/optics/front-of-lens-filter.d.ts +45 -14
- package/dist/optics/front-of-lens-filter.js +259 -88
- package/dist/optics/front-of-lens-filter.js.map +1 -1
- package/dist/optics/illumination-vignetting.d.ts +16 -17
- package/dist/optics/illumination-vignetting.js +40 -17
- package/dist/optics/illumination-vignetting.js.map +1 -1
- package/dist/optics/irradiance-convolution.d.ts +59 -0
- package/dist/optics/irradiance-convolution.js +138 -0
- package/dist/optics/irradiance-convolution.js.map +1 -0
- package/dist/optics/lateral-chromatic-aberration.d.ts +33 -30
- package/dist/optics/lateral-chromatic-aberration.js +33 -23
- package/dist/optics/lateral-chromatic-aberration.js.map +1 -1
- package/dist/optics/lens-psf-kernels.d.ts +89 -0
- package/dist/optics/lens-psf-kernels.js +175 -0
- package/dist/optics/lens-psf-kernels.js.map +1 -0
- package/dist/optics/lens-psf-profile.d.ts +78 -46
- package/dist/optics/lens-psf-profile.js +335 -124
- package/dist/optics/lens-psf-profile.js.map +1 -1
- package/dist/optics/longitudinal-chromatic-aberration.d.ts +102 -0
- package/dist/optics/longitudinal-chromatic-aberration.js +210 -0
- package/dist/optics/longitudinal-chromatic-aberration.js.map +1 -0
- package/dist/optics/polygon-diffraction.d.ts +80 -23
- package/dist/optics/polygon-diffraction.js +130 -25
- package/dist/optics/polygon-diffraction.js.map +1 -1
- package/dist/optics/profile-contract.d.ts +5 -6
- package/dist/optics/profile-contract.js +14 -11
- package/dist/optics/profile-contract.js.map +1 -1
- package/dist/optics/psf-foundation.d.ts +23 -23
- package/dist/optics/psf-foundation.js +24 -21
- package/dist/optics/psf-foundation.js.map +1 -1
- package/dist/optics/pupil-vignetting.d.ts +118 -0
- package/dist/optics/pupil-vignetting.js +264 -0
- package/dist/optics/pupil-vignetting.js.map +1 -0
- package/dist/optics/radial-distortion.d.ts +34 -33
- package/dist/optics/radial-distortion.js +37 -30
- package/dist/optics/radial-distortion.js.map +1 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts +47 -33
- package/dist/optics/scene-to-sensor-irradiance.js +73 -45
- package/dist/optics/scene-to-sensor-irradiance.js.map +1 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts +23 -18
- package/dist/optics/scene-to-sensor-quadrature.js +16 -11
- package/dist/optics/scene-to-sensor-quadrature.js.map +1 -1
- package/dist/optics/sensor-aperture-rays.d.ts +20 -4
- package/dist/optics/sensor-aperture-rays.js +32 -14
- package/dist/optics/sensor-aperture-rays.js.map +1 -1
- package/dist/optics/sensor-environment-query.d.ts +81 -16
- package/dist/optics/sensor-environment-query.js +145 -12
- package/dist/optics/sensor-environment-query.js.map +1 -1
- package/dist/optics/sensor-psf-quadrature.d.ts +12 -10
- package/dist/optics/sensor-psf-quadrature.js +18 -11
- package/dist/optics/sensor-psf-quadrature.js.map +1 -1
- package/dist/optics/sensor-psf-support.d.ts +8 -6
- package/dist/optics/sensor-psf-support.js +8 -5
- package/dist/optics/sensor-psf-support.js.map +1 -1
- package/dist/optics/stray-light.d.ts +22 -19
- package/dist/optics/stray-light.js +18 -12
- package/dist/optics/stray-light.js.map +1 -1
- package/dist/optics/thin-lens.d.ts +10 -9
- package/dist/optics/thin-lens.js +12 -8
- package/dist/optics/thin-lens.js.map +1 -1
- package/dist/optics/zernike-wavefront.d.ts +154 -0
- package/dist/optics/zernike-wavefront.js +352 -0
- package/dist/optics/zernike-wavefront.js.map +1 -0
- package/dist/output/capture-corrected-sdr.d.ts +16 -8
- package/dist/output/capture-corrected-sdr.js +16 -8
- package/dist/output/capture-corrected-sdr.js.map +1 -1
- package/dist/output/capture-geometry.d.ts +34 -36
- package/dist/output/capture-geometry.js +52 -32
- package/dist/output/capture-geometry.js.map +1 -1
- package/dist/output/capture-sdr.d.ts +7 -6
- package/dist/output/capture-sdr.js +11 -8
- package/dist/output/capture-sdr.js.map +1 -1
- package/dist/output/crop.d.ts +22 -6
- package/dist/output/crop.js +40 -6
- package/dist/output/crop.js.map +1 -1
- package/dist/output/geometric-transforms.d.ts +60 -23
- package/dist/output/geometric-transforms.js +111 -24
- package/dist/output/geometric-transforms.js.map +1 -1
- package/dist/output/lens-corrections.d.ts +27 -19
- package/dist/output/lens-corrections.js +29 -13
- package/dist/output/lens-corrections.js.map +1 -1
- package/dist/output/native-capture-sdr.d.ts +71 -16
- package/dist/output/native-capture-sdr.js +190 -33
- package/dist/output/native-capture-sdr.js.map +1 -1
- package/dist/output/png-encoder.d.ts +65 -0
- package/dist/output/png-encoder.js +461 -0
- package/dist/output/png-encoder.js.map +1 -0
- package/dist/output/print-contrast-reference.d.ts +10 -9
- package/dist/output/print-contrast-reference.js +10 -8
- package/dist/output/print-contrast-reference.js.map +1 -1
- package/dist/output/print-detail.d.ts +18 -17
- package/dist/output/print-detail.js +12 -10
- package/dist/output/print-detail.js.map +1 -1
- package/dist/output/print-jpeg.d.ts +26 -5
- package/dist/output/print-jpeg.js +117 -50
- package/dist/output/print-jpeg.js.map +1 -1
- package/dist/output/print-plan.d.ts +19 -19
- package/dist/output/print-plan.js +11 -10
- package/dist/output/print-plan.js.map +1 -1
- package/dist/output/print-region-statistics.d.ts +14 -15
- package/dist/output/print-region-statistics.js +11 -11
- package/dist/output/print-region-statistics.js.map +1 -1
- package/dist/output/sdr-rendering.d.ts +48 -10
- package/dist/output/sdr-rendering.js +114 -25
- package/dist/output/sdr-rendering.js.map +1 -1
- package/dist/output/subject-framing-crop.d.ts +6 -10
- package/dist/output/subject-framing-crop.js +23 -13
- package/dist/output/subject-framing-crop.js.map +1 -1
- package/dist/processing/demosaic.d.ts +90 -0
- package/dist/processing/demosaic.js +275 -0
- package/dist/processing/demosaic.js.map +1 -0
- package/dist/processing/denoise.d.ts +68 -0
- package/dist/processing/denoise.js +214 -0
- package/dist/processing/denoise.js.map +1 -0
- package/dist/processing/focus-stacking.d.ts +17 -0
- package/dist/processing/focus-stacking.js +80 -0
- package/dist/processing/focus-stacking.js.map +1 -0
- package/dist/processing/hdr.d.ts +54 -0
- package/dist/processing/hdr.js +172 -0
- package/dist/processing/hdr.js.map +1 -0
- package/dist/processing/image-ops.d.ts +66 -0
- package/dist/processing/image-ops.js +192 -0
- package/dist/processing/image-ops.js.map +1 -0
- package/dist/processing/panorama.d.ts +51 -0
- package/dist/processing/panorama.js +305 -0
- package/dist/processing/panorama.js.map +1 -0
- package/dist/processing/processing-task.d.ts +85 -0
- package/dist/processing/processing-task.js +164 -0
- package/dist/processing/processing-task.js.map +1 -0
- package/dist/processing/tone-mapping.d.ts +69 -0
- package/dist/processing/tone-mapping.js +310 -0
- package/dist/processing/tone-mapping.js.map +1 -0
- package/dist/schema/camera.d.ts +5 -4
- package/dist/schema/illumination-spectral.d.ts +13 -19
- package/dist/schema/illumination-spectral.js +23 -19
- package/dist/schema/illumination-spectral.js.map +1 -1
- package/dist/schema/illumination-temporal.d.ts +12 -15
- package/dist/schema/illumination-temporal.js +43 -28
- package/dist/schema/illumination-temporal.js.map +1 -1
- package/dist/schema/illumination.d.ts +5 -4
- package/dist/schema/illumination.js +55 -20
- package/dist/schema/illumination.js.map +1 -1
- package/dist/schema/scene-radiance-temporal.d.ts +9 -11
- package/dist/schema/scene-radiance-temporal.js +26 -23
- package/dist/schema/scene-radiance-temporal.js.map +1 -1
- package/dist/schema/scene-radiance.d.ts +17 -17
- package/dist/schema/scene-radiance.js +56 -34
- package/dist/schema/scene-radiance.js.map +1 -1
- package/dist/schema/scene.d.ts +14 -13
- package/dist/schema/validation.d.ts +0 -1
- package/dist/schema/validation.js +17 -15
- package/dist/schema/validation.js.map +1 -1
- package/dist/sensor/accumulated-charge.d.ts +45 -64
- package/dist/sensor/accumulated-charge.js +41 -47
- package/dist/sensor/accumulated-charge.js.map +1 -1
- package/dist/sensor/architecture.d.ts +22 -25
- package/dist/sensor/architecture.js +17 -16
- package/dist/sensor/architecture.js.map +1 -1
- package/dist/sensor/camera-saturation-capacity.d.ts +21 -28
- package/dist/sensor/camera-saturation-capacity.js +36 -34
- package/dist/sensor/camera-saturation-capacity.js.map +1 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts +46 -51
- package/dist/sensor/capture-color-sampling-binding.js +39 -41
- package/dist/sensor/capture-color-sampling-binding.js.map +1 -1
- package/dist/sensor/capture-mode-timing.d.ts +8 -9
- package/dist/sensor/capture-mode-timing.js +24 -21
- package/dist/sensor/capture-mode-timing.js.map +1 -1
- package/dist/sensor/capture-mode.d.ts +28 -30
- package/dist/sensor/capture-mode.js +33 -31
- package/dist/sensor/capture-mode.js.map +1 -1
- package/dist/sensor/color-sampling.d.ts +30 -33
- package/dist/sensor/color-sampling.js +32 -37
- package/dist/sensor/color-sampling.js.map +1 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts +19 -23
- package/dist/sensor/constant-rate-temporal-integration.js +28 -26
- package/dist/sensor/constant-rate-temporal-integration.js.map +1 -1
- package/dist/sensor/dark-current.d.ts +53 -49
- package/dist/sensor/dark-current.js +87 -46
- package/dist/sensor/dark-current.js.map +1 -1
- package/dist/sensor/environment-photo-signal.d.ts +71 -30
- package/dist/sensor/environment-photo-signal.js +127 -46
- package/dist/sensor/environment-photo-signal.js.map +1 -1
- package/dist/sensor/eqe-electron-rate.d.ts +14 -13
- package/dist/sensor/eqe-electron-rate.js +34 -14
- package/dist/sensor/eqe-electron-rate.js.map +1 -1
- package/dist/sensor/eqe-local-exposure.d.ts +24 -24
- package/dist/sensor/eqe-local-exposure.js +15 -11
- package/dist/sensor/eqe-local-exposure.js.map +1 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts +11 -11
- package/dist/sensor/eqe-temporal-exposure.js +15 -10
- package/dist/sensor/eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/exposure-window.d.ts +48 -34
- package/dist/sensor/exposure-window.js +77 -36
- package/dist/sensor/exposure-window.js.map +1 -1
- package/dist/sensor/fixed-pattern-noise.d.ts +108 -0
- package/dist/sensor/fixed-pattern-noise.js +166 -0
- package/dist/sensor/fixed-pattern-noise.js.map +1 -0
- package/dist/sensor/iso-gain.d.ts +44 -0
- package/dist/sensor/iso-gain.js +119 -0
- package/dist/sensor/iso-gain.js.map +1 -0
- package/dist/sensor/iso-signal-chain.d.ts +25 -48
- package/dist/sensor/iso-signal-chain.js +52 -66
- package/dist/sensor/iso-signal-chain.js.map +1 -1
- package/dist/sensor/local-exposure-binding.d.ts +21 -21
- package/dist/sensor/local-exposure-binding.js +22 -18
- package/dist/sensor/local-exposure-binding.js.map +1 -1
- package/dist/sensor/optical-stack.d.ts +36 -40
- package/dist/sensor/optical-stack.js +34 -37
- package/dist/sensor/optical-stack.js.map +1 -1
- package/dist/sensor/photon-energy.d.ts +22 -28
- package/dist/sensor/photon-energy.js +42 -34
- package/dist/sensor/photon-energy.js.map +1 -1
- package/dist/sensor/physical-charge-capacity.d.ts +20 -30
- package/dist/sensor/physical-charge-capacity.js +35 -36
- package/dist/sensor/physical-charge-capacity.js.map +1 -1
- package/dist/sensor/pixel-pitch.d.ts +2 -3
- package/dist/sensor/pixel-pitch.js +4 -2
- package/dist/sensor/pixel-pitch.js.map +1 -1
- package/dist/sensor/radiometry-readiness.d.ts +13 -15
- package/dist/sensor/radiometry-readiness.js +20 -17
- package/dist/sensor/radiometry-readiness.js.map +1 -1
- package/dist/sensor/raw-readout.d.ts +173 -83
- package/dist/sensor/raw-readout.js +425 -160
- package/dist/sensor/raw-readout.js.map +1 -1
- package/dist/sensor/raw-reconstruction.d.ts +112 -44
- package/dist/sensor/raw-reconstruction.js +200 -47
- package/dist/sensor/raw-reconstruction.js.map +1 -1
- package/dist/sensor/readout-exposure-linkage.d.ts +103 -34
- package/dist/sensor/readout-exposure-linkage.js +125 -27
- package/dist/sensor/readout-exposure-linkage.js.map +1 -1
- package/dist/sensor/readout-timing.d.ts +43 -44
- package/dist/sensor/readout-timing.js +38 -30
- package/dist/sensor/readout-timing.js.map +1 -1
- package/dist/sensor/response-application-compatibility.d.ts +21 -28
- package/dist/sensor/response-application-compatibility.js +35 -34
- package/dist/sensor/response-application-compatibility.js.map +1 -1
- package/dist/sensor/response-operating-range.d.ts +26 -35
- package/dist/sensor/response-operating-range.js +40 -39
- package/dist/sensor/response-operating-range.js.map +1 -1
- package/dist/sensor/responsivity-photocurrent.d.ts +21 -29
- package/dist/sensor/responsivity-photocurrent.js +57 -40
- package/dist/sensor/responsivity-photocurrent.js.map +1 -1
- package/dist/sensor/sampling-aperture.d.ts +21 -25
- package/dist/sensor/sampling-aperture.js +29 -28
- package/dist/sensor/sampling-aperture.js.map +1 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts +14 -12
- package/dist/sensor/scene-eqe-temporal-exposure.js +13 -8
- package/dist/sensor/scene-eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/sensor-geometry.d.ts +28 -32
- package/dist/sensor/sensor-geometry.js +35 -20
- package/dist/sensor/sensor-geometry.js.map +1 -1
- package/dist/sensor/signal-noise.d.ts +14 -16
- package/dist/sensor/signal-noise.js +15 -13
- package/dist/sensor/signal-noise.js.map +1 -1
- package/dist/sensor/spatial-sample-reduction.d.ts +45 -60
- package/dist/sensor/spatial-sample-reduction.js +39 -48
- package/dist/sensor/spatial-sample-reduction.js.map +1 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts +46 -54
- package/dist/sensor/spatial-sampling-quadrature.js +31 -36
- package/dist/sensor/spatial-sampling-quadrature.js.map +1 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts +32 -42
- package/dist/sensor/spatio-spectral-reduction.js +24 -29
- package/dist/sensor/spatio-spectral-reduction.js.map +1 -1
- package/dist/sensor/spectral-coverage.d.ts +6 -9
- package/dist/sensor/spectral-coverage.js +9 -6
- package/dist/sensor/spectral-coverage.js.map +1 -1
- package/dist/sensor/spectral-quadrature.d.ts +46 -60
- package/dist/sensor/spectral-quadrature.js +38 -48
- package/dist/sensor/spectral-quadrature.js.map +1 -1
- package/dist/sensor/spectral-response.d.ts +53 -41
- package/dist/sensor/spectral-response.js +80 -47
- package/dist/sensor/spectral-response.js.map +1 -1
- package/dist/sensor/stochastic-seed.d.ts +50 -0
- package/dist/sensor/stochastic-seed.js +123 -0
- package/dist/sensor/stochastic-seed.js.map +1 -0
- package/dist/sensor/temporal-eqe-sum.d.ts +2 -4
- package/dist/sensor/temporal-eqe-sum.js +5 -6
- package/dist/sensor/temporal-eqe-sum.js.map +1 -1
- package/dist/sensor/temporal-photo-signal.d.ts +5 -6
- package/dist/sensor/temporal-photo-signal.js +11 -10
- package/dist/sensor/temporal-photo-signal.js.map +1 -1
- package/dist/sensor/temporal-sample-binding.d.ts +1 -2
- package/dist/sensor/temporal-sample-binding.js +3 -3
- package/dist/sensor/temporal-sample-binding.js.map +1 -1
- package/dist/simulation/poc-simulation.d.ts +16 -16
- package/dist/simulation/poc-simulation.js +20 -15
- package/dist/simulation/poc-simulation.js.map +1 -1
- package/dist/stabilization/camera-shake.d.ts +42 -18
- package/dist/stabilization/camera-shake.js +43 -20
- package/dist/stabilization/camera-shake.js.map +1 -1
- package/dist/stabilization/system.d.ts +44 -41
- package/dist/stabilization/system.js +196 -108
- package/dist/stabilization/system.js.map +1 -1
- package/docs/AGENT_GUIDE.md +183 -0
- package/docs/API_REFERENCE.md +761 -2
- package/docs/QUICK_START.md +495 -0
- package/docs/USAGE.md +1719 -714
- package/docs/api/camera-equivalent-focal-length.md +6 -7
- package/docs/api/camera-field-of-view.md +16 -8
- package/docs/api/camera-lens-projection.md +246 -0
- package/docs/api/camera-projected-object-size.md +6 -5
- package/docs/api/capture-capture-export-metadata.md +10 -10
- package/docs/api/capture-dng-import.md +134 -0
- package/docs/api/capture-environment-raw-producer.md +17 -11
- package/docs/api/capture-export-jpeg.md +16 -0
- package/docs/api/capture-focus-control.md +25 -47
- package/docs/api/capture-linear-encoding.md +21 -12
- package/docs/api/capture-lossless-jpeg.md +49 -0
- package/docs/api/capture-native-environment-optical-stage.md +75 -0
- package/docs/api/capture-native-environment-raw.md +161 -4
- package/docs/api/capture-native-raw-development.md +69 -4
- package/docs/api/capture-native-raw-dng.md +84 -0
- package/docs/api/capture-native-raw.md +23 -8
- package/docs/api/capture-packed-sensor-raw.md +156 -0
- package/docs/api/capture-photographic-export.md +69 -31
- package/docs/api/capture-raw-frame-reconstruction.md +8 -8
- package/docs/api/capture-raw-white-level.md +37 -0
- package/docs/api/capture-release-sequence.md +6 -7
- package/docs/api/capture-sensor-raw-frame.md +6 -6
- package/docs/api/capture-sensor-raw-producer.md +17 -11
- package/docs/api/capture-simulated-capture.md +15 -15
- package/docs/api/color-camera-color-matrix.md +103 -0
- package/docs/api/color-capture-color.md +22 -11
- package/docs/api/color-chromatic-adaptation.md +82 -0
- package/docs/api/color-color-difference.md +134 -0
- package/docs/api/color-color-matching-functions.md +259 -0
- package/docs/api/color-colorimetry-math.md +54 -0
- package/docs/api/color-gamut-mapping.md +72 -0
- package/docs/api/color-illuminants.md +280 -0
- package/docs/api/color-rgb-color-spaces.md +151 -0
- package/docs/api/color-sensor-color-development.md +27 -0
- package/docs/api/color-srgb-icc.md +2 -4
- package/docs/api/color-white-balance.md +95 -19
- package/docs/api/composition-image-formation-plan.md +124 -95
- package/docs/api/composition-plan-consumer.md +7 -7
- package/docs/api/core-calculation-result.md +18 -14
- package/docs/api/core-configuration-error.md +1 -1
- package/docs/api/core-image-formation.md +7 -7
- package/docs/api/core-scientific-assurance.md +12 -10
- package/docs/api/core-spectral-composition.md +14 -14
- package/docs/api/core-spectral.md +6 -6
- package/docs/api/core-validation.md +3 -3
- package/docs/api/core-version.md +7 -6
- package/docs/api/equipment-exposure-capabilities.md +11 -10
- package/docs/api/equipment-generic-tier-assets.md +7 -2
- package/docs/api/equipment-generic-tier-presets.md +6 -6
- package/docs/api/equipment-iso-capabilities.md +18 -18
- package/docs/api/equipment-metering-capabilities.md +6 -6
- package/docs/api/equipment-release-capabilities.md +4 -4
- package/docs/api/exports.json +2213 -8
- package/docs/api/exposure-exposure-duration-control.md +9 -9
- package/docs/api/exposure-exposure-mode-resolver.md +35 -31
- package/docs/api/exposure-exposure.md +10 -10
- package/docs/api/exposure-flash-ttl.md +182 -0
- package/docs/api/exposure-flash.md +183 -28
- package/docs/api/exposure-metering-scene-radiance.md +11 -10
- package/docs/api/exposure-metering-target.md +9 -8
- package/docs/api/exposure-metering-temporal.md +8 -8
- package/docs/api/exposure-metering.md +69 -9
- package/docs/api/exposure-program-line.md +6 -5
- package/docs/api/facade-chart-radiance-batch.md +96 -0
- package/docs/api/facade-chart-scenes.md +240 -0
- package/docs/api/facade-scene-radiance.md +122 -0
- package/docs/api/facade-simulate-capture.md +324 -0
- package/docs/api/gpu-image-kernel-accelerator.md +157 -0
- package/docs/api/gpu-image-kernel-execution.md +152 -0
- package/docs/api/motion-camera-rotation.md +43 -26
- package/docs/api/motion-capture-rotation-inverse-mapping.md +24 -23
- package/docs/api/motion-capture-rotation-temporal-quadrature.md +22 -22
- package/docs/api/motion-capture-rotation-trajectory.md +15 -15
- package/docs/api/motion-capture-translation-parallax-temporal-quadrature.md +15 -14
- package/docs/api/motion-extended-object-projection.md +10 -8
- package/docs/api/motion-projected-motion.md +8 -8
- package/docs/api/motion-temporal-exposure-sum.md +98 -0
- package/docs/api/motion-video-sequence.md +159 -0
- package/docs/api/optics-aperture.md +8 -8
- package/docs/api/optics-atmospheric-haze.md +104 -0
- package/docs/api/optics-brown-conrady-distortion.md +123 -0
- package/docs/api/optics-circle-of-confusion.md +5 -4
- package/docs/api/optics-complex-pupil-psf.md +57 -16
- package/docs/api/optics-depth-of-field.md +12 -6
- package/docs/api/optics-diffraction.md +8 -7
- package/docs/api/optics-focus-breathing.md +104 -16
- package/docs/api/optics-focus-state.md +9 -10
- package/docs/api/optics-front-of-lens-filter.md +72 -14
- package/docs/api/optics-illumination-vignetting.md +10 -10
- package/docs/api/optics-irradiance-convolution.md +95 -0
- package/docs/api/optics-lateral-chromatic-aberration.md +22 -21
- package/docs/api/optics-lens-psf-kernels.md +72 -0
- package/docs/api/optics-lens-psf-profile.md +48 -26
- package/docs/api/optics-longitudinal-chromatic-aberration.md +128 -0
- package/docs/api/optics-polygon-diffraction.md +78 -13
- package/docs/api/optics-profile-contract.md +4 -4
- package/docs/api/optics-psf-foundation.md +12 -12
- package/docs/api/optics-pupil-vignetting.md +132 -0
- package/docs/api/optics-radial-distortion.md +12 -12
- package/docs/api/optics-scene-to-sensor-irradiance.md +25 -14
- package/docs/api/optics-scene-to-sensor-quadrature.md +15 -12
- package/docs/api/optics-sensor-aperture-rays.md +3 -2
- package/docs/api/optics-sensor-environment-query.md +52 -9
- package/docs/api/optics-sensor-psf-quadrature.md +13 -10
- package/docs/api/optics-stray-light.md +12 -11
- package/docs/api/optics-thin-lens.md +4 -3
- package/docs/api/optics-zernike-wavefront.md +229 -0
- package/docs/api/output-capture-corrected-sdr.md +10 -7
- package/docs/api/output-capture-geometry.md +35 -36
- package/docs/api/output-capture-sdr.md +4 -4
- package/docs/api/output-crop.md +7 -4
- package/docs/api/output-geometric-transforms.md +65 -19
- package/docs/api/output-lens-corrections.md +17 -15
- package/docs/api/output-native-capture-sdr.md +26 -13
- package/docs/api/output-png-encoder.md +105 -0
- package/docs/api/output-print-contrast-reference.md +8 -8
- package/docs/api/output-print-detail.md +14 -14
- package/docs/api/output-print-jpeg.md +22 -5
- package/docs/api/output-print-plan.md +18 -18
- package/docs/api/output-print-region-statistics.md +14 -14
- package/docs/api/output-sdr-rendering.md +52 -10
- package/docs/api/output-subject-framing-crop.md +5 -6
- package/docs/api/processing-demosaic.md +120 -0
- package/docs/api/processing-denoise.md +148 -0
- package/docs/api/processing-focus-stacking.md +41 -0
- package/docs/api/processing-hdr.md +113 -0
- package/docs/api/processing-panorama.md +82 -0
- package/docs/api/processing-processing-task.md +107 -0
- package/docs/api/processing-tone-mapping.md +142 -0
- package/docs/api/schema-camera.md +6 -4
- package/docs/api/schema-illumination-spectral.md +10 -11
- package/docs/api/schema-illumination-temporal.md +13 -15
- package/docs/api/schema-illumination.md +4 -4
- package/docs/api/schema-scene-radiance-temporal.md +10 -11
- package/docs/api/schema-scene-radiance.md +18 -17
- package/docs/api/schema-scene.md +9 -9
- package/docs/api/schema-validation.md +1 -1
- package/docs/api/sensor-accumulated-charge.md +12 -20
- package/docs/api/sensor-architecture.md +15 -16
- package/docs/api/sensor-camera-saturation-capacity.md +9 -11
- package/docs/api/sensor-capture-color-sampling-binding.md +47 -51
- package/docs/api/sensor-capture-mode-timing.md +9 -9
- package/docs/api/sensor-capture-mode.md +29 -30
- package/docs/api/sensor-color-sampling.md +31 -33
- package/docs/api/sensor-constant-rate-temporal-integration.md +10 -11
- package/docs/api/sensor-dark-current.md +30 -14
- package/docs/api/sensor-environment-photo-signal.md +13 -6
- package/docs/api/sensor-eqe-electron-rate.md +9 -8
- package/docs/api/sensor-eqe-local-exposure.md +18 -17
- package/docs/api/sensor-eqe-temporal-exposure.md +12 -11
- package/docs/api/sensor-exposure-window.md +24 -24
- package/docs/api/sensor-fixed-pattern-noise.md +104 -0
- package/docs/api/sensor-iso-gain.md +63 -0
- package/docs/api/sensor-iso-signal-chain.md +13 -22
- package/docs/api/sensor-local-exposure-binding.md +12 -13
- package/docs/api/sensor-optical-stack.md +37 -40
- package/docs/api/sensor-photon-energy.md +10 -11
- package/docs/api/sensor-physical-charge-capacity.md +8 -13
- package/docs/api/sensor-pixel-pitch.md +1 -1
- package/docs/api/sensor-radiometry-readiness.md +9 -9
- package/docs/api/sensor-raw-readout.md +118 -52
- package/docs/api/sensor-raw-reconstruction.md +97 -20
- package/docs/api/sensor-readout-exposure-linkage.md +120 -24
- package/docs/api/sensor-readout-timing.md +33 -35
- package/docs/api/sensor-response-application-compatibility.md +9 -11
- package/docs/api/sensor-response-operating-range.md +14 -18
- package/docs/api/sensor-responsivity-photocurrent.md +9 -12
- package/docs/api/sensor-sampling-aperture.md +22 -25
- package/docs/api/sensor-scene-eqe-temporal-exposure.md +9 -8
- package/docs/api/sensor-sensor-geometry.md +23 -24
- package/docs/api/sensor-signal-noise.md +10 -10
- package/docs/api/sensor-spatial-sample-reduction.md +27 -30
- package/docs/api/sensor-spatial-sampling-quadrature.md +37 -39
- package/docs/api/sensor-spatio-spectral-reduction.md +27 -29
- package/docs/api/sensor-spectral-coverage.md +5 -5
- package/docs/api/sensor-spectral-quadrature.md +33 -35
- package/docs/api/sensor-spectral-response.md +28 -16
- package/docs/api/sensor-temporal-photo-signal.md +6 -6
- package/docs/api/simulation-poc-simulation.md +17 -16
- package/docs/api/stabilization-camera-shake.md +29 -10
- package/docs/api/stabilization-system.md +25 -21
- package/docs/examples/production-request.json +3821 -2157
- package/docs/examples/simulate-capture.mjs +14 -0
- package/llms.txt +35 -0
- package/package.json +32 -12
- package/AGENTS.md +0 -674
- package/CONTRIBUTING.md +0 -76
- package/DCO +0 -33
- package/dist/camera/equivalent-focal-length.d.ts.map +0 -1
- package/dist/camera/field-of-view.d.ts.map +0 -1
- package/dist/camera/projected-object-size.d.ts.map +0 -1
- package/dist/capture/capture-export-metadata.d.ts.map +0 -1
- package/dist/capture/environment-raw-producer.d.ts.map +0 -1
- package/dist/capture/export-jpeg.d.ts.map +0 -1
- package/dist/capture/export-tiff.d.ts.map +0 -1
- package/dist/capture/focus-control.d.ts.map +0 -1
- package/dist/capture/linear-encoding.d.ts.map +0 -1
- package/dist/capture/native-environment-raw.d.ts.map +0 -1
- package/dist/capture/native-raw-development.d.ts.map +0 -1
- package/dist/capture/native-raw.d.ts.map +0 -1
- package/dist/capture/photographic-export.d.ts.map +0 -1
- package/dist/capture/raw-frame-limits.d.ts.map +0 -1
- package/dist/capture/raw-frame-reconstruction.d.ts.map +0 -1
- package/dist/capture/release-sequence.d.ts.map +0 -1
- package/dist/capture/sensor-raw-frame.d.ts.map +0 -1
- package/dist/capture/sensor-raw-producer.d.ts.map +0 -1
- package/dist/capture/simulated-capture.d.ts.map +0 -1
- package/dist/color/capture-color.d.ts.map +0 -1
- package/dist/color/sensor-color-development.d.ts.map +0 -1
- package/dist/color/srgb-icc.d.ts.map +0 -1
- package/dist/color/srgb-transfer.d.ts.map +0 -1
- package/dist/color/white-balance.d.ts.map +0 -1
- package/dist/composition/image-formation-plan.d.ts.map +0 -1
- package/dist/composition/plan-consumer.d.ts.map +0 -1
- package/dist/core/calculation-result.d.ts.map +0 -1
- package/dist/core/canonical-json.d.ts.map +0 -1
- package/dist/core/configuration-error.d.ts.map +0 -1
- package/dist/core/evidence-provenance.d.ts.map +0 -1
- package/dist/core/image-formation.d.ts.map +0 -1
- package/dist/core/owned-data.d.ts.map +0 -1
- package/dist/core/record-validation.d.ts.map +0 -1
- package/dist/core/scientific-assurance.d.ts.map +0 -1
- package/dist/core/spectral-composition.d.ts.map +0 -1
- package/dist/core/spectral.d.ts.map +0 -1
- package/dist/core/validation.d.ts.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/equipment/exposure-capabilities.d.ts.map +0 -1
- package/dist/equipment/generic-tier-assets.d.ts.map +0 -1
- package/dist/equipment/generic-tier-presets.d.ts.map +0 -1
- package/dist/equipment/iso-capabilities.d.ts.map +0 -1
- package/dist/equipment/metering-capabilities.d.ts.map +0 -1
- package/dist/equipment/release-capabilities.d.ts.map +0 -1
- package/dist/exposure/exposure-duration-control.d.ts.map +0 -1
- package/dist/exposure/exposure-mode-resolver.d.ts.map +0 -1
- package/dist/exposure/exposure.d.ts.map +0 -1
- package/dist/exposure/flash.d.ts.map +0 -1
- package/dist/exposure/metering-scene-radiance.d.ts.map +0 -1
- package/dist/exposure/metering-target.d.ts.map +0 -1
- package/dist/exposure/metering-temporal.d.ts.map +0 -1
- package/dist/exposure/metering.d.ts.map +0 -1
- package/dist/exposure/program-line.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/motion/camera-rotation.d.ts.map +0 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts.map +0 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/capture-rotation-trajectory.d.ts.map +0 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/extended-object-projection.d.ts.map +0 -1
- package/dist/motion/projected-motion.d.ts.map +0 -1
- package/dist/optics/aperture.d.ts.map +0 -1
- package/dist/optics/circle-of-confusion.d.ts.map +0 -1
- package/dist/optics/complex-pupil-psf.d.ts.map +0 -1
- package/dist/optics/depth-of-field.d.ts.map +0 -1
- package/dist/optics/diffraction.d.ts.map +0 -1
- package/dist/optics/focus-breathing.d.ts.map +0 -1
- package/dist/optics/focus-state.d.ts.map +0 -1
- package/dist/optics/front-of-lens-filter.d.ts.map +0 -1
- package/dist/optics/illumination-vignetting.d.ts.map +0 -1
- package/dist/optics/lateral-chromatic-aberration.d.ts.map +0 -1
- package/dist/optics/lens-psf-profile.d.ts.map +0 -1
- package/dist/optics/polygon-diffraction.d.ts.map +0 -1
- package/dist/optics/profile-contract.d.ts.map +0 -1
- package/dist/optics/psf-foundation.d.ts.map +0 -1
- package/dist/optics/radial-distortion.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-aperture-rays.d.ts.map +0 -1
- package/dist/optics/sensor-environment-query.d.ts.map +0 -1
- package/dist/optics/sensor-psf-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-psf-support.d.ts.map +0 -1
- package/dist/optics/stray-light.d.ts.map +0 -1
- package/dist/optics/thin-lens.d.ts.map +0 -1
- package/dist/output/capture-corrected-sdr.d.ts.map +0 -1
- package/dist/output/capture-geometry.d.ts.map +0 -1
- package/dist/output/capture-sdr.d.ts.map +0 -1
- package/dist/output/crop.d.ts.map +0 -1
- package/dist/output/geometric-transforms.d.ts.map +0 -1
- package/dist/output/lens-corrections.d.ts.map +0 -1
- package/dist/output/native-capture-sdr.d.ts.map +0 -1
- package/dist/output/print-contrast-reference.d.ts.map +0 -1
- package/dist/output/print-detail.d.ts.map +0 -1
- package/dist/output/print-jpeg.d.ts.map +0 -1
- package/dist/output/print-plan.d.ts.map +0 -1
- package/dist/output/print-region-statistics.d.ts.map +0 -1
- package/dist/output/sdr-rendering.d.ts.map +0 -1
- package/dist/output/subject-framing-crop.d.ts.map +0 -1
- package/dist/schema/camera.d.ts.map +0 -1
- package/dist/schema/camera.js +0 -3
- package/dist/schema/camera.js.map +0 -1
- package/dist/schema/illumination-spectral.d.ts.map +0 -1
- package/dist/schema/illumination-temporal.d.ts.map +0 -1
- package/dist/schema/illumination.d.ts.map +0 -1
- package/dist/schema/scene-radiance-temporal.d.ts.map +0 -1
- package/dist/schema/scene-radiance.d.ts.map +0 -1
- package/dist/schema/scene.d.ts.map +0 -1
- package/dist/schema/scene.js +0 -3
- package/dist/schema/scene.js.map +0 -1
- package/dist/schema/validation.d.ts.map +0 -1
- package/dist/sensor/accumulated-charge.d.ts.map +0 -1
- package/dist/sensor/architecture.d.ts.map +0 -1
- package/dist/sensor/camera-saturation-capacity.d.ts.map +0 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts.map +0 -1
- package/dist/sensor/capture-mode-timing.d.ts.map +0 -1
- package/dist/sensor/capture-mode.d.ts.map +0 -1
- package/dist/sensor/color-sampling.d.ts.map +0 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts.map +0 -1
- package/dist/sensor/dark-current.d.ts.map +0 -1
- package/dist/sensor/environment-photo-signal.d.ts.map +0 -1
- package/dist/sensor/eqe-electron-rate.d.ts.map +0 -1
- package/dist/sensor/eqe-local-exposure.d.ts.map +0 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/exposure-window.d.ts.map +0 -1
- package/dist/sensor/iso-signal-chain.d.ts.map +0 -1
- package/dist/sensor/local-exposure-binding.d.ts.map +0 -1
- package/dist/sensor/optical-stack.d.ts.map +0 -1
- package/dist/sensor/photon-energy.d.ts.map +0 -1
- package/dist/sensor/physical-charge-capacity.d.ts.map +0 -1
- package/dist/sensor/pixel-pitch.d.ts.map +0 -1
- package/dist/sensor/radiometry-readiness.d.ts.map +0 -1
- package/dist/sensor/raw-readout.d.ts.map +0 -1
- package/dist/sensor/raw-reconstruction.d.ts.map +0 -1
- package/dist/sensor/readout-exposure-linkage.d.ts.map +0 -1
- package/dist/sensor/readout-timing.d.ts.map +0 -1
- package/dist/sensor/response-application-compatibility.d.ts.map +0 -1
- package/dist/sensor/response-operating-range.d.ts.map +0 -1
- package/dist/sensor/responsivity-photocurrent.d.ts.map +0 -1
- package/dist/sensor/sampling-aperture.d.ts.map +0 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/sensor-geometry.d.ts.map +0 -1
- package/dist/sensor/signal-noise.d.ts.map +0 -1
- package/dist/sensor/spatial-sample-reduction.d.ts.map +0 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts.map +0 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts.map +0 -1
- package/dist/sensor/spectral-coverage.d.ts.map +0 -1
- package/dist/sensor/spectral-quadrature.d.ts.map +0 -1
- package/dist/sensor/spectral-response.d.ts.map +0 -1
- package/dist/sensor/temporal-eqe-sum.d.ts.map +0 -1
- package/dist/sensor/temporal-photo-signal.d.ts.map +0 -1
- package/dist/sensor/temporal-sample-binding.d.ts.map +0 -1
- package/dist/simulation/poc-simulation.d.ts.map +0 -1
- package/dist/stabilization/camera-shake.d.ts.map +0 -1
- package/dist/stabilization/system.d.ts.map +0 -1
- package/docs/API_STYLE.md +0 -235
- package/docs/ARCHITECTURE.md +0 -356
- package/docs/AUTOMATION_COORDINATION.md +0 -190
- package/docs/CAPTURE_COLOR.md +0 -25
- package/docs/CAPTURE_CORRECTED_SDR.md +0 -25
- package/docs/CAPTURE_EXPORT_METADATA.md +0 -27
- package/docs/CAPTURE_SDR.md +0 -22
- package/docs/DEVELOPERS.md +0 -68
- package/docs/DIGITAL_OPTICS_FOUNDATION.md +0 -69
- package/docs/ENVIRONMENT_RAW_CAPTURE.md +0 -208
- package/docs/EXPORT_ACCEPTANCE.md +0 -133
- package/docs/GENERIC_TIER_PRESETS.md +0 -269
- package/docs/GEOMETRIC_PREPARATION_REUSE.md +0 -141
- package/docs/IMAGE_FORMATION.md +0 -247
- package/docs/LINEAR_CAPTURE_ENCODING.md +0 -25
- package/docs/MOTION_AND_SIGNAL.md +0 -250
- package/docs/NATIVE_CAPTURE_SDR.md +0 -70
- package/docs/NATIVE_CAPTURE_SDR_REVIEW.md +0 -37
- package/docs/NATIVE_CAPTURE_SDR_VALIDATION.md +0 -34
- package/docs/NATIVE_RAW_AND_PRINT.md +0 -47
- package/docs/NUMERICAL_CORRECTNESS.md +0 -191
- package/docs/PERFORMANCE_BASELINE.md +0 -56
- package/docs/PHOTOGRAPHIC_EXPORT.md +0 -206
- package/docs/PHYSICS_FOUNDATION.md +0 -426
- package/docs/POC_API.md +0 -278
- package/docs/POC_PROJECTION_PLATFORM_REFERENCE.md +0 -12
- package/docs/POC_PROJECTION_REUSE.md +0 -124
- package/docs/PRINT_195_196_REVIEW.md +0 -93
- package/docs/PRINT_196_ENGINE_ACCEPTANCE.md +0 -45
- package/docs/PRINT_CONTRAST_REFERENCE.md +0 -43
- package/docs/PRINT_DETAIL_ASSESSMENT.md +0 -81
- package/docs/PRINT_DETAIL_JPEG_EVIDENCE.md +0 -36
- package/docs/PRINT_DETAIL_SDR_EVIDENCE.md +0 -29
- package/docs/PRINT_DETAIL_VALIDATION.md +0 -36
- package/docs/PRINT_PLANNING.md +0 -75
- package/docs/PRINT_REGION_STATISTICS.md +0 -38
- package/docs/PROCESSED_OUTPUT.md +0 -157
- package/docs/PRODUCTION_COMPOSITION.md +0 -373
- package/docs/PRODUCTION_ENVIRONMENT_CAPTURE.md +0 -131
- package/docs/PROVENANCE.md +0 -115
- package/docs/PSF_FOUNDATION.md +0 -165
- package/docs/RAW_FRAME_ENVELOPE.md +0 -56
- package/docs/RAW_FRAME_RECONSTRUCTION.md +0 -30
- package/docs/RELEASE_1_0.md +0 -66
- package/docs/RELEASE_1_0_1.md +0 -61
- package/docs/RELEASE_1_1_0.md +0 -25
- package/docs/RELEASE_1_2_0.md +0 -51
- package/docs/RELEASE_1_3_0.md +0 -15
- package/docs/RELEASE_1_4_0.md +0 -23
- package/docs/RELEASE_AUDIT.md +0 -39
- package/docs/SCENE_RADIANCE_AND_ILLUMINATION.md +0 -298
- package/docs/SCENE_SENSOR_QUADRATURE.md +0 -98
- package/docs/SCENE_SENSOR_TEMPORAL_EXPOSURE.md +0 -86
- package/docs/SCIENTIFIC_ASSURANCE.md +0 -280
- package/docs/SCIENTIFIC_CONFORMANCE.md +0 -83
- package/docs/SDR_RENDERING.md +0 -33
- package/docs/SENSOR_APERTURE_RAYS.md +0 -23
- package/docs/SENSOR_ENVIRONMENT_QUERY.md +0 -86
- package/docs/SENSOR_EQE_LOCAL_EXPOSURE.md +0 -104
- package/docs/SENSOR_EQE_TEMPORAL_EXPOSURE.md +0 -74
- package/docs/SENSOR_PSF_QUADRATURE.md +0 -90
- package/docs/SENSOR_RAW_FRAME.md +0 -20
- package/docs/SENSOR_RAW_PRODUCER.md +0 -77
- package/docs/SIGNAL_CONFORMANCE.md +0 -23
- package/docs/SIMULATED_CAPTURE.md +0 -65
- package/docs/STABILIZATION.md +0 -234
- package/docs/TEMPORAL_PHOTO_RAW.md +0 -83
- package/docs/TIER_ACCEPTANCE.md +0 -129
- package/docs/TIER_PRESET_ACCEPTANCE.md +0 -59
- package/docs/V1_COMPOSITION_MAP.md +0 -123
- package/docs/V1_HELPER_REUSE_REVIEW.md +0 -60
- package/docs/V1_PERFORMANCE_DISPOSITION.md +0 -88
- package/docs/benchmarks/2026-10-01-main-baseline.json +0 -694
- package/docs/benchmarks/2026-10-02-geometric-preparation-reuse.json +0 -2190
- package/docs/benchmarks/2026-10-02-poc-projection-reuse.json +0 -2423
- package/docs/benchmarks/2026-10-02-v1-environment-gc-profile.json +0 -210
- package/docs/benchmarks/2026-10-02-v1-environment-ordinary.json +0 -187
- package/docs/benchmarks/2026-10-02-v1-geometry-gc-profile.json +0 -756
- package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-1.json +0 -711
- package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-2.json +0 -711
- package/docs/benchmarks/2026-10-02-v1-poc-gc-profile.json +0 -885
- package/docs/benchmarks/2026-10-02-v1-poc-ordinary-1.json +0 -868
- package/docs/benchmarks/2026-10-02-v1-poc-ordinary-2.json +0 -868
- package/docs/licenses/castleCSF-MIT.txt +0 -21
- package/docs/validation/documentation-fragments.json +0 -212
- package/docs/validation/native-capture-sdr-darwin-arm64-node26-review.jsonl +0 -4
- package/docs/validation/native-capture-sdr-darwin-arm64.jsonl +0 -3
- package/docs/validation/native-raw-print-2026-10-04/fractional-asymmetric-crop.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/gray-ramp.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/linear-area-checker.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/manifest.json +0 -218
- package/docs/validation/native-raw-print-2026-10-04/megapixel-native.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/native-color.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel-validation.json +0 -9
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json +0 -29
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.codes.u16le.gz +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.rgb.gz +0 -0
- package/docs/validation/native-raw-print-2026-10-04/srgb.icc +0 -0
- package/docs/validation/native-raw-print-2026-10-04/validation.json +0 -41
- package/docs/validation/print-196-candidate-capabilities.json +0 -28
- package/docs/validation/print-196-candidate-evidence.json +0 -356
- package/docs/validation/print-196-engine-acceptance.json +0 -81
- package/docs/validation/print-detail-capabilities.json +0 -103
- package/docs/validation/print-detail-jpeg-evidence.json +0 -116
- package/docs/validation/print-detail-sdr-evidence.json +0 -81
- package/docs/validation/release-audit-inventory.json +0 -1306
- package/docs/validation/tier-acceptance-report-v1.json +0 -2538
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* plain-record and cycle validation. This is serialization mechanics, not a general input parser,
|
|
9
|
-
* cryptographic hash or standardized canonical-JSON claim.
|
|
3
|
+
* Deterministic JSON text for engine-owned plain data, with object keys sorted.
|
|
4
|
+
*
|
|
5
|
+
* The same data always gives the same text, so records can be compared by identity.
|
|
6
|
+
* This is serialization only. It is not a general input parser, a cryptographic hash or
|
|
7
|
+
* an implementation of a canonical-JSON standard.
|
|
10
8
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
11
9
|
*/
|
|
12
10
|
import { InvalidConfigurationError } from "./configuration-error.js";
|
|
13
11
|
/**
|
|
14
|
-
* Serializes a parsed, acyclic plain
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* Serializes a parsed, acyclic tree of plain data to JSON text.
|
|
13
|
+
*
|
|
14
|
+
* Object keys (enumerable) are sorted. Arrays keep their order. Numbers must be finite.
|
|
15
|
+
* String escaping and negative zero follow JSON.stringify. The input is never changed.
|
|
16
|
+
*
|
|
17
|
+
* The domain policy decides what happens to undefined object properties. These always
|
|
18
|
+
* fail with the policy's unsupported-value message:
|
|
19
|
+
* - undefined array entries and array holes;
|
|
20
|
+
* - non-plain objects (Map, Set, Date, typed arrays, class instances, or any prototype
|
|
21
|
+
* other than Object.prototype or null);
|
|
22
|
+
* - unsupported scalar types.
|
|
17
23
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* plain-record and cycle validation. This is serialization mechanics, not a
|
|
21
|
-
* general input parser, cryptographic hash or standardized canonical-JSON claim.
|
|
24
|
+
* The caller must rule out cycles first. This is serialization only. It is not a general
|
|
25
|
+
* input parser, a cryptographic hash or an implementation of a canonical-JSON standard.
|
|
22
26
|
*/
|
|
23
27
|
export function stringifyCanonicalJson(value, policy) {
|
|
24
28
|
if (value === null || typeof value === "string" || typeof value === "boolean") {
|
|
@@ -30,9 +34,24 @@ export function stringifyCanonicalJson(value, policy) {
|
|
|
30
34
|
return JSON.stringify(value);
|
|
31
35
|
}
|
|
32
36
|
if (Array.isArray(value)) {
|
|
33
|
-
|
|
37
|
+
if (Object.getPrototypeOf(value) !== Array.prototype) {
|
|
38
|
+
throw new InvalidConfigurationError(policy.unsupportedValueMessage);
|
|
39
|
+
}
|
|
40
|
+
let serialized = "[";
|
|
41
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
42
|
+
// Holes are not JSON data; Array#map would skip them and emit invalid JSON.
|
|
43
|
+
if (!Object.prototype.hasOwnProperty.call(value, index)) {
|
|
44
|
+
throw new InvalidConfigurationError(policy.unsupportedValueMessage);
|
|
45
|
+
}
|
|
46
|
+
serialized += (index === 0 ? "" : ",") + stringifyCanonicalJson(value[index], policy);
|
|
47
|
+
}
|
|
48
|
+
return serialized + "]";
|
|
34
49
|
}
|
|
35
50
|
if (typeof value === "object") {
|
|
51
|
+
const prototype = Object.getPrototypeOf(value);
|
|
52
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
53
|
+
throw new InvalidConfigurationError(policy.unsupportedValueMessage);
|
|
54
|
+
}
|
|
36
55
|
const record = value;
|
|
37
56
|
const keys = Object.keys(record)
|
|
38
57
|
.filter((key) => policy.undefinedObjectProperties !== "omit" || record[key] !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../../src/core/canonical-json.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"canonical-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AC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,UAAU,GAAG,GAAG,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAY,CAAC;QAC1D,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACzD,MAAM,IAAI,yBAAyB,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;aAC7B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,yBAAyB,KAAK,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC;aACzF,IAAI,EAAE,CAAC;QACV,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAC1H,CAAC;IACD,MAAM,IAAI,yBAAyB,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACtE,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Deterministic JSON text for engine-owned plain data, with object keys sorted.\n *\n * The same data always gives the same text, so records can be compared by identity.\n * This is serialization only. It is not a general input parser, a cryptographic hash or\n * an implementation of a canonical-JSON standard.\n * @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.\n */\n\nimport { InvalidConfigurationError } from \"./configuration-error.js\";\n\n/** Domain-specific omissions and diagnostics are part of serialized identity. */\nexport interface CanonicalJsonPolicy {\n undefinedObjectProperties: \"omit\" | \"reject\";\n nonFiniteNumberMessage: string;\n unsupportedValueMessage: string;\n}\n\n/**\n * Serializes a parsed, acyclic tree of plain data to JSON text.\n *\n * Object keys (enumerable) are sorted. Arrays keep their order. Numbers must be finite.\n * String escaping and negative zero follow JSON.stringify. The input is never changed.\n *\n * The domain policy decides what happens to undefined object properties. These always\n * fail with the policy's unsupported-value message:\n * - undefined array entries and array holes;\n * - non-plain objects (Map, Set, Date, typed arrays, class instances, or any prototype\n * other than Object.prototype or null);\n * - unsupported scalar types.\n *\n * The caller must rule out cycles first. This is serialization only. It is not a general\n * input parser, a cryptographic hash or an implementation of a canonical-JSON standard.\n */\nexport function stringifyCanonicalJson(value: unknown, policy: CanonicalJsonPolicy): string {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return JSON.stringify(value);\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw new InvalidConfigurationError(policy.nonFiniteNumberMessage);\n return JSON.stringify(value);\n }\n if (Array.isArray(value)) {\n if (Object.getPrototypeOf(value) !== Array.prototype) {\n throw new InvalidConfigurationError(policy.unsupportedValueMessage);\n }\n let serialized = \"[\";\n for (let index = 0; index < value.length; index += 1) {\n // Holes are not JSON data; Array#map would skip them and emit invalid JSON.\n if (!Object.prototype.hasOwnProperty.call(value, index)) {\n throw new InvalidConfigurationError(policy.unsupportedValueMessage);\n }\n serialized += (index === 0 ? \"\" : \",\") + stringifyCanonicalJson(value[index], policy);\n }\n return serialized + \"]\";\n }\n if (typeof value === \"object\") {\n const prototype = Object.getPrototypeOf(value) as unknown;\n if (prototype !== Object.prototype && prototype !== null) {\n throw new InvalidConfigurationError(policy.unsupportedValueMessage);\n }\n const record = value as Record<string, unknown>;\n const keys = Object.keys(record)\n .filter((key) => policy.undefinedObjectProperties !== \"omit\" || record[key] !== undefined)\n .sort();\n return \"{\" + keys.map((key) => JSON.stringify(key) + \":\" + stringifyCanonicalJson(record[key], policy)).join(\",\") + \"}\";\n }\n throw new InvalidConfigurationError(policy.unsupportedValueMessage);\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The typed error for malformed configuration data.
|
|
3
|
+
*
|
|
4
|
+
* A malformed configuration is different from a valid request the engine cannot yet
|
|
5
|
+
* serve. Parsers throw this error instead of guessing at invalid schema or policy data.
|
|
6
|
+
* A valid but unsupported request does not throw; it returns structured blockers.
|
|
5
7
|
* @see docs/RELEASE_1_0.md and the corresponding domain guide.
|
|
6
8
|
*/
|
|
7
9
|
/**
|
|
@@ -12,4 +14,3 @@ export declare class InvalidConfigurationError extends TypeError {
|
|
|
12
14
|
readonly code = "INVALID_CONFIGURATION";
|
|
13
15
|
constructor(message: string);
|
|
14
16
|
}
|
|
15
|
-
//# sourceMappingURL=configuration-error.d.ts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The typed error for malformed configuration data.
|
|
4
|
+
*
|
|
5
|
+
* A malformed configuration is different from a valid request the engine cannot yet
|
|
6
|
+
* serve. Parsers throw this error instead of guessing at invalid schema or policy data.
|
|
7
|
+
* A valid but unsupported request does not throw; it returns structured blockers.
|
|
6
8
|
* @see docs/RELEASE_1_0.md and the corresponding domain guide.
|
|
7
9
|
*/
|
|
8
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-error.js","sourceRoot":"","sources":["../../src/core/configuration-error.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"configuration-error.js","sourceRoot":"","sources":["../../src/core/configuration-error.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAS;IAC7C,IAAI,GAAG,uBAAuB,CAAC;IAExC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The typed error for malformed configuration data.\n *\n * A malformed configuration is different from a valid request the engine cannot yet\n * serve. Parsers throw this error instead of guessing at invalid schema or policy data.\n * A valid but unsupported request does not throw; it returns structured blockers.\n * @see docs/RELEASE_1_0.md and the corresponding domain guide.\n */\n\n/**\n * Error thrown when external configuration data does not match a public\n * runtime schema.\n */\nexport class InvalidConfigurationError extends TypeError {\n readonly code = \"INVALID_CONFIGURATION\";\n\n constructor(message: string) {\n super(message);\n this.name = \"InvalidConfigurationError\";\n }\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export type EvidenceSourceOrigin = "manufacturer" | "third-party" | "photivra";
|
|
2
2
|
export type EvidenceReuseStatus = "factual-reference-only" | "reusable-data" | "photivra-owned";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Where one scientific fact or numeric data set came from, and what reuse rights apply.
|
|
5
|
+
*
|
|
6
|
+
* Being publicly available does not grant permission to copy. The engine stores the
|
|
7
|
+
* source reference as metadata and never fetches it. A record is a declaration for a
|
|
8
|
+
* human to review. It does not verify a calibration or a licence.
|
|
8
9
|
*/
|
|
9
10
|
export interface EvidenceProvenance {
|
|
10
11
|
/** Who originated the underlying fact/data. */
|
|
@@ -16,11 +17,11 @@ export interface EvidenceProvenance {
|
|
|
16
17
|
*/
|
|
17
18
|
sourceReference: string;
|
|
18
19
|
/**
|
|
19
|
-
* How
|
|
20
|
+
* How Photivra may use the referenced material.
|
|
20
21
|
*
|
|
21
|
-
* This is
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* This is independent of who the source is. A manufacturer or third party can
|
|
23
|
+
* publish material that is only a factual reference, or data explicitly licensed
|
|
24
|
+
* for reuse.
|
|
24
25
|
*/
|
|
25
26
|
reuseStatus: EvidenceReuseStatus;
|
|
26
27
|
/** Required when reuseStatus is reusable-data. */
|
|
@@ -33,14 +34,13 @@ export interface EvidenceBackedFact<T> {
|
|
|
33
34
|
evidence: readonly EvidenceProvenance[];
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
* Parses one provenance
|
|
37
|
+
* Parses one provenance (evidence) record.
|
|
37
38
|
*
|
|
38
|
-
* Source origin and reuse status are
|
|
39
|
-
*
|
|
39
|
+
* Source origin and reuse status are independent of each other. The parser rejects
|
|
40
|
+
* only combinations that contradict themselves.
|
|
40
41
|
*/
|
|
41
42
|
export declare function parseEvidenceProvenance(value: unknown, path: string): EvidenceProvenance;
|
|
42
43
|
/**
|
|
43
44
|
* Parses a non-empty evidence array.
|
|
44
45
|
*/
|
|
45
46
|
export declare function parseEvidenceList(value: unknown, path: string): readonly EvidenceProvenance[];
|
|
46
|
-
//# sourceMappingURL=evidence-provenance.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The parser only rejects combinations that are intrinsically contradictory.
|
|
6
|
-
* Parses a non-empty evidence array.
|
|
3
|
+
* Provenance records: where a scientific fact or data set came from, and whether Photivra
|
|
4
|
+
* may reuse it. Parsers for one record and for a non-empty list of records.
|
|
7
5
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
8
6
|
*/
|
|
7
|
+
import { rejectUnknownFields } from "./record-validation.js";
|
|
9
8
|
import { InvalidConfigurationError } from "./configuration-error.js";
|
|
10
9
|
const SOURCE_ORIGINS = new Set([
|
|
11
10
|
"manufacturer",
|
|
@@ -17,10 +16,12 @@ const REUSE_STATUSES = new Set([
|
|
|
17
16
|
"reusable-data",
|
|
18
17
|
"photivra-owned"
|
|
19
18
|
]);
|
|
20
|
-
function requireRecord(value, path) {
|
|
19
|
+
function requireRecord(value, path, allowedKeys) {
|
|
21
20
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
22
21
|
throw new InvalidConfigurationError(`${path} must be an object.`);
|
|
23
22
|
}
|
|
23
|
+
if (allowedKeys !== null)
|
|
24
|
+
rejectUnknownFields(value, allowedKeys, path);
|
|
24
25
|
return value;
|
|
25
26
|
}
|
|
26
27
|
function requireNonEmptyString(record, key, path) {
|
|
@@ -31,13 +32,13 @@ function requireNonEmptyString(record, key, path) {
|
|
|
31
32
|
return value;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
* Parses one provenance
|
|
35
|
+
* Parses one provenance (evidence) record.
|
|
35
36
|
*
|
|
36
|
-
* Source origin and reuse status are
|
|
37
|
-
*
|
|
37
|
+
* Source origin and reuse status are independent of each other. The parser rejects
|
|
38
|
+
* only combinations that contradict themselves.
|
|
38
39
|
*/
|
|
39
40
|
export function parseEvidenceProvenance(value, path) {
|
|
40
|
-
const record = requireRecord(value, path);
|
|
41
|
+
const record = requireRecord(value, path, ["sourceOrigin", "sourceReference", "reuseStatus", "license", "note"]);
|
|
41
42
|
const sourceOrigin = requireNonEmptyString(record, "sourceOrigin", path);
|
|
42
43
|
const sourceReference = requireNonEmptyString(record, "sourceReference", path);
|
|
43
44
|
const reuseStatus = requireNonEmptyString(record, "reuseStatus", path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence-provenance.js","sourceRoot":"","sources":["../../src/core/evidence-provenance.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"evidence-provenance.js","sourceRoot":"","sources":["../../src/core/evidence-provenance.ts"],"names":[],"mappings":"AAAA,sCAA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ACzB,IACE,IAAI,KAAK,SAAS;QAClB,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,EACtD,CAAC;QACD,MAAM,IAAI,yBAAyB,CACjC,GAAG,IAAI,iDAAiD,CACzD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,WAAW;QACzB,eAAe;QACf,WAAW,EAAE,gBAAgB;QAC7B,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;QAC7C,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,IAAY;IAEZ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,yBAAyB,CACjC,GAAG,IAAI,6BAA6B,CACrC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAChC,uBAAuB,CAAC,KAAK,EAAE,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,CACpD,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Provenance records: where a scientific fact or data set came from, and whether Photivra\n * may reuse it. Parsers for one record and for a non-empty list of records.\n * @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.\n */\n\nimport { rejectUnknownFields } from \"./record-validation.js\";\nimport { InvalidConfigurationError } from \"./configuration-error.js\";\n\ntype UnknownRecord = Record<string, unknown>;\n\nexport type EvidenceSourceOrigin =\n | \"manufacturer\"\n | \"third-party\"\n | \"photivra\";\n\nexport type EvidenceReuseStatus =\n | \"factual-reference-only\"\n | \"reusable-data\"\n | \"photivra-owned\";\n\n/**\n * Where one scientific fact or numeric data set came from, and what reuse rights apply.\n *\n * Being publicly available does not grant permission to copy. The engine stores the\n * source reference as metadata and never fetches it. A record is a declaration for a\n * human to review. It does not verify a calibration or a licence.\n */\nexport interface EvidenceProvenance {\n /** Who originated the underlying fact/data. */\n sourceOrigin: EvidenceSourceOrigin;\n /**\n * Public/stable source reference or Photivra evidence identifier.\n *\n * The engine does not fetch this reference at runtime.\n */\n sourceReference: string;\n /**\n * How Photivra may use the referenced material.\n *\n * This is independent of who the source is. A manufacturer or third party can\n * publish material that is only a factual reference, or data explicitly licensed\n * for reuse.\n */\n reuseStatus: EvidenceReuseStatus;\n /** Required when reuseStatus is reusable-data. */\n license?: string;\n note?: string;\n}\n\nexport interface EvidenceBackedFact<T> {\n value: T;\n /** One or more independent evidence records supporting this fact. */\n evidence: readonly EvidenceProvenance[];\n}\n\nconst SOURCE_ORIGINS = new Set<EvidenceSourceOrigin>([\n \"manufacturer\",\n \"third-party\",\n \"photivra\"\n]);\n\nconst REUSE_STATUSES = new Set<EvidenceReuseStatus>([\n \"factual-reference-only\",\n \"reusable-data\",\n \"photivra-owned\"\n]);\n\nfunction requireRecord(\n value: unknown,\n path: string,\n allowedKeys: readonly string[] | null\n): UnknownRecord {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new InvalidConfigurationError(`${path} must be an object.`);\n }\n if (allowedKeys !== null) rejectUnknownFields(value, allowedKeys, path);\n return value as UnknownRecord;\n}\n\nfunction requireNonEmptyString(\n record: UnknownRecord,\n key: string,\n path: string\n): string {\n const value = record[key];\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new InvalidConfigurationError(\n `${path}.${key} must be a non-empty string.`\n );\n }\n return value;\n}\n\n/**\n * Parses one provenance (evidence) record.\n *\n * Source origin and reuse status are independent of each other. The parser rejects\n * only combinations that contradict themselves.\n */\nexport function parseEvidenceProvenance(\n value: unknown,\n path: string\n): EvidenceProvenance {\n const record = requireRecord(value, path, [\"sourceOrigin\", \"sourceReference\", \"reuseStatus\", \"license\", \"note\"]);\n const sourceOrigin = requireNonEmptyString(record, \"sourceOrigin\", path);\n const sourceReference = requireNonEmptyString(\n record,\n \"sourceReference\",\n path\n );\n const reuseStatus = requireNonEmptyString(record, \"reuseStatus\", path);\n\n if (!SOURCE_ORIGINS.has(sourceOrigin as EvidenceSourceOrigin)) {\n throw new InvalidConfigurationError(`${path}.sourceOrigin is invalid.`);\n }\n if (!REUSE_STATUSES.has(reuseStatus as EvidenceReuseStatus)) {\n throw new InvalidConfigurationError(`${path}.reuseStatus is invalid.`);\n }\n\n const typedOrigin = sourceOrigin as EvidenceSourceOrigin;\n const typedReuseStatus = reuseStatus as EvidenceReuseStatus;\n\n if (\n typedReuseStatus === \"photivra-owned\" &&\n typedOrigin !== \"photivra\"\n ) {\n throw new InvalidConfigurationError(\n `${path}.photivra-owned evidence must have sourceOrigin \"photivra\".`\n );\n }\n\n const license = record.license;\n if (\n license !== undefined &&\n (typeof license !== \"string\" || license.trim().length === 0)\n ) {\n throw new InvalidConfigurationError(\n `${path}.license must be a non-empty string when supplied.`\n );\n }\n if (typedReuseStatus === \"reusable-data\" && license === undefined) {\n throw new InvalidConfigurationError(\n `${path}.license is required for reusable-data provenance.`\n );\n }\n\n const note = record.note;\n if (\n note !== undefined &&\n (typeof note !== \"string\" || note.trim().length === 0)\n ) {\n throw new InvalidConfigurationError(\n `${path}.note must be a non-empty string when supplied.`\n );\n }\n\n return {\n sourceOrigin: typedOrigin,\n sourceReference,\n reuseStatus: typedReuseStatus,\n ...(license === undefined ? {} : { license }),\n ...(note === undefined ? {} : { note })\n };\n}\n\n/**\n * Parses a non-empty evidence array.\n */\nexport function parseEvidenceList(\n value: unknown,\n path: string\n): readonly EvidenceProvenance[] {\n if (!Array.isArray(value) || value.length === 0) {\n throw new InvalidConfigurationError(\n `${path} must be a non-empty array.`\n );\n }\n\n return value.map((entry, index) =>\n parseEvidenceProvenance(entry, `${path}[${index}]`)\n );\n}\n"]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The image-formation contract: the ordered stages from scene light to output image, and
|
|
3
|
+
* which part of the system owns each stage.
|
|
4
|
+
*
|
|
5
|
+
* It is descriptive metadata. It is not a renderer, and listing a stage does not mean the
|
|
6
|
+
* stage is implemented yet.
|
|
5
7
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
6
8
|
*/
|
|
7
9
|
/**
|
|
8
10
|
* Version of the public image-formation ordering contract.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
* versions. It
|
|
12
|
-
*
|
|
12
|
+
* It is separate from the package, root-engine and composed proof-of-concept (POC)
|
|
13
|
+
* versions. It covers only stage order and ownership. It does not mean every listed
|
|
14
|
+
* stage is implemented.
|
|
13
15
|
*/
|
|
14
16
|
export declare const IMAGE_FORMATION_CONTRACT_VERSION: "0.4.0";
|
|
15
17
|
export type ImageFormationDomainId = "scene-ray-geometry" | "scene-radiance-formation" | "lens-pupil-throughput" | "field-wavelength-psf" | "temporal-exposure-readout" | "sensor-output-display";
|
|
@@ -67,10 +69,9 @@ export interface ImageFormationContract {
|
|
|
67
69
|
notes: readonly string[];
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
|
-
* Returns the
|
|
72
|
+
* Returns the image-formation contract: the order of stages and who owns each one.
|
|
71
73
|
*
|
|
72
|
-
* The result is descriptive metadata
|
|
73
|
-
*
|
|
74
|
+
* The result is descriptive metadata. It is not a renderer, and a listed stage is not
|
|
75
|
+
* necessarily available yet.
|
|
74
76
|
*/
|
|
75
77
|
export declare function getImageFormationContract(): ImageFormationContract;
|
|
76
|
-
//# sourceMappingURL=image-formation.d.ts.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The image-formation contract: the ordered stages from scene light to output image, and
|
|
4
|
+
* which part of the system owns each stage.
|
|
5
|
+
*
|
|
6
|
+
* It is descriptive metadata. It is not a renderer, and listing a stage does not mean the
|
|
7
|
+
* stage is implemented yet.
|
|
6
8
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
7
9
|
*/
|
|
8
10
|
/**
|
|
9
11
|
* Version of the public image-formation ordering contract.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
* versions. It
|
|
13
|
-
*
|
|
13
|
+
* It is separate from the package, root-engine and composed proof-of-concept (POC)
|
|
14
|
+
* versions. It covers only stage order and ownership. It does not mean every listed
|
|
15
|
+
* stage is implemented.
|
|
14
16
|
*/
|
|
15
17
|
export const IMAGE_FORMATION_CONTRACT_VERSION = "0.4.0";
|
|
16
18
|
const DOMAINS = [
|
|
@@ -331,10 +333,10 @@ const NOTES = [
|
|
|
331
333
|
"The primary lens-throughput bridge converts validated outgoing spectral radiance to pre-sensor-stack spectral irradiance through declared pupil acceptance, exactly one optical-transmission path, and at most one declared field-throughput term. It does not apply sensor optical-stack/CFA/QE response, PSF energy redistribution, stray light, or an implicit distortion brightness correction."
|
|
332
334
|
];
|
|
333
335
|
/**
|
|
334
|
-
* Returns the
|
|
336
|
+
* Returns the image-formation contract: the order of stages and who owns each one.
|
|
335
337
|
*
|
|
336
|
-
* The result is descriptive metadata
|
|
337
|
-
*
|
|
338
|
+
* The result is descriptive metadata. It is not a renderer, and a listed stage is not
|
|
339
|
+
* necessarily available yet.
|
|
338
340
|
*/
|
|
339
341
|
export function getImageFormationContract() {
|
|
340
342
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-formation.js","sourceRoot":"","sources":["../../src/core/image-formation.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;GAKG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G,QAAQ,EAAE;QACzB,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;KAClB,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The image-formation contract: the ordered stages from scene light to output image, and\n * which part of the system owns each stage.\n *\n * It is descriptive metadata. It is not a renderer, and listing a stage does not mean the\n * stage is implemented yet.\n * @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.\n */\n\n/**\n * Version of the public image-formation ordering contract.\n *\n * It is separate from the package, root-engine and composed proof-of-concept (POC)\n * versions. It covers only stage order and ownership. It does not mean every listed\n * stage is implemented.\n */\nexport const IMAGE_FORMATION_CONTRACT_VERSION = \"0.4.0\" as const;\n\nexport type ImageFormationDomainId =\n | \"scene-ray-geometry\"\n | \"scene-radiance-formation\"\n | \"lens-pupil-throughput\"\n | \"field-wavelength-psf\"\n | \"temporal-exposure-readout\"\n | \"sensor-output-display\";\n\nexport type ImageFormationCoordinateSpaceId =\n | \"scene-metric\"\n | \"image-plane-metric\"\n | \"native-sensor-physical\"\n | \"native-raster\"\n | \"oriented-capture-raster\"\n | \"output-raster\"\n | \"display\";\n\nexport type ImageFormationStageId =\n | \"scene-ray-projection\"\n | \"scene-radiance-evaluation\"\n | \"lens-field-pupil-evaluation\"\n | \"field-wavelength-psf\"\n | \"temporal-exposure-readout\"\n | \"sensor-optical-stack\"\n | \"photosite-cfa-sampling\"\n | \"sensor-charge-statistics\"\n | \"read-noise-conversion\"\n | \"adc-quantization\"\n | \"reconstruction\"\n | \"physical-orientation-transform\"\n | \"output-crop-resample\"\n | \"display-processing\";\n\nexport type ImageFormationImplementationStatus =\n | \"existing-foundation\"\n | \"partial-foundation\"\n | \"reserved-contract\";\n\nexport type ImageFormationEffectId =\n | \"focus-breathing\"\n | \"geometric-distortion\"\n | \"lateral-chromatic-aberration\"\n | \"illumination-vignetting\"\n | \"mechanical-vignetting\"\n | \"non-circular-diffraction\"\n | \"field-curvature\"\n | \"field-sharpness-falloff\"\n | \"field-dependent-bokeh\"\n | \"spatial-camera-rotation\"\n | \"rolling-readout\"\n | \"photosite-cfa-sampling\"\n | \"photon-charge-statistics\"\n | \"read-noise-conversion\"\n | \"demosaic-remosaic\";\n\nexport interface ImageFormationCoordinateSpaceContract {\n id: ImageFormationCoordinateSpaceId;\n unit: \"m\" | \"mm\" | \"px\" | \"display-dependent\";\n origin: string;\n axes: string;\n note: string;\n}\n\nexport interface ImageFormationStageContract {\n id: ImageFormationStageId;\n domain: ImageFormationDomainId;\n status: ImageFormationImplementationStatus;\n coordinateSpaces: readonly ImageFormationCoordinateSpaceId[];\n requiredUpstreamStages: readonly ImageFormationStageId[];\n coupledStages: readonly ImageFormationStageId[];\n purpose: string;\n}\n\nexport interface ImageFormationEffectPlacement {\n id: ImageFormationEffectId;\n primaryStage: ImageFormationStageId;\n coupledStages: readonly ImageFormationStageId[];\n note: string;\n}\n\nexport interface ImageFormationTemporalContract {\n authoritativeTimeUnit: \"s\";\n origin: \"exposure-start\";\n normalizedTimeIsDerivedOnly: true;\n exposureDurationAndReadoutTimingAreIndependent: true;\n globalReadoutDoesNotImplyZeroMotionBlur: true;\n nativeReadoutDirectionRemainsNativeUnderOrientation: true;\n note: string;\n}\n\nexport interface ImageFormationRendererContract {\n geometricWarpSampling: \"inverse-map-destination-to-source\";\n alphaRepresentation: \"premultiplied\";\n occlusionRule: \"preserve-depth-order-across-warps\";\n previewAndReferenceShareScientificContract: true;\n backendMayApproximateButNotRedefineSemantics: true;\n note: string;\n}\n\nexport interface ImageFormationContract {\n version: typeof IMAGE_FORMATION_CONTRACT_VERSION;\n domains: readonly ImageFormationDomainId[];\n coordinateSpaces: readonly ImageFormationCoordinateSpaceContract[];\n stages: readonly ImageFormationStageContract[];\n effectPlacements: readonly ImageFormationEffectPlacement[];\n temporal: ImageFormationTemporalContract;\n renderer: ImageFormationRendererContract;\n notes: readonly string[];\n}\n\nconst DOMAINS = [\n \"scene-ray-geometry\",\n \"scene-radiance-formation\",\n \"lens-pupil-throughput\",\n \"field-wavelength-psf\",\n \"temporal-exposure-readout\",\n \"sensor-output-display\"\n] as const satisfies readonly ImageFormationDomainId[];\n\nconst COORDINATE_SPACES = [\n {\n id: \"scene-metric\",\n unit: \"m\",\n origin: \"scene/camera model defined by the scene or projection contract\",\n axes: \"scene/world axes remain owned by the scene/projection contract\",\n note: \"Do not reinterpret scene axes as raster axes.\"\n },\n {\n id: \"image-plane-metric\",\n unit: \"mm\",\n origin: \"optical axis\",\n axes: \"+X right, +Y up\",\n note: \"This preserves the legacy projected-motion/image-plane convention.\"\n },\n {\n id: \"native-sensor-physical\",\n unit: \"mm\",\n origin: \"optical axis\",\n axes: \"+X right, +Y down in native sensor-facing coordinates\",\n note: \"Physical sensor coordinates remain invariant under camera orientation.\"\n },\n {\n id: \"native-raster\",\n unit: \"px\",\n origin: \"top-left of the native effective image raster\",\n axes: \"+X right, +Y down; rectangles use half-open integer extents\",\n note: \"Native coordinates remain invariant under physical camera rotation.\"\n },\n {\n id: \"oriented-capture-raster\",\n unit: \"px\",\n origin: \"top-left after the explicit physical-orientation transform\",\n axes: \"+X right, +Y down\",\n note: \"This is derived from native coordinates; it never redefines native readout direction.\"\n },\n {\n id: \"output-raster\",\n unit: \"px\",\n origin: \"top-left of the declared output raster\",\n axes: \"+X right, +Y down\",\n note: \"Digital crop/resampling does not mutate physical sensor identity.\"\n },\n {\n id: \"display\",\n unit: \"display-dependent\",\n origin: \"consumer/display contract\",\n axes: \"consumer/display contract\",\n note: \"Display/tone/UI coordinates are not authoritative camera-science coordinates.\"\n }\n] as const satisfies readonly ImageFormationCoordinateSpaceContract[];\n\nconst STAGES = [\n {\n id: \"scene-ray-projection\",\n domain: \"scene-ray-geometry\",\n status: \"existing-foundation\",\n coordinateSpaces: [\"scene-metric\", \"image-plane-metric\"],\n requiredUpstreamStages: [],\n coupledStages: [\n \"scene-radiance-evaluation\",\n \"temporal-exposure-readout\"\n ],\n purpose:\n \"Project scene geometry into the optical image plane while preserving explicit metric geometry and focus-aware projection.\"\n },\n {\n id: \"scene-radiance-evaluation\",\n domain: \"scene-radiance-formation\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"scene-metric\"],\n requiredUpstreamStages: [\"scene-ray-projection\"],\n coupledStages: [\"temporal-exposure-readout\"],\n purpose:\n \"Own outgoing scene spectral-radiance formation from illumination, scene geometry/visibility, material optical response, emission, indirect transport, and time. The current foundation establishes ownership and illumination-source metadata only; it does not calculate scene radiance.\"\n },\n {\n id: \"lens-field-pupil-evaluation\",\n domain: \"lens-pupil-throughput\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"image-plane-metric\", \"native-sensor-physical\"],\n requiredUpstreamStages: [\n \"scene-ray-projection\",\n \"scene-radiance-evaluation\"\n ],\n coupledStages: [\"field-wavelength-psf\"],\n purpose:\n \"Own focus-dependent framing, geometric field mapping, pupil/acceptance geometry, spectral optical transmission, field throughput, and the primary intended bridge from outgoing scene spectral radiance to pre-sensor-stack sensor-plane spectral irradiance. PSF redistribution remains separately owned downstream.\"\n },\n {\n id: \"field-wavelength-psf\",\n domain: \"field-wavelength-psf\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"image-plane-metric\", \"native-sensor-physical\"],\n requiredUpstreamStages: [\"lens-field-pupil-evaluation\"],\n coupledStages: [\"temporal-exposure-readout\"],\n purpose:\n \"Own field-, depth-, pupil-, and wavelength-dependent point-spread behavior including defocus and diffraction without collapsing independent effects into one undocumented blur scalar.\"\n },\n {\n id: \"temporal-exposure-readout\",\n domain: \"temporal-exposure-readout\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"scene-metric\", \"image-plane-metric\", \"native-raster\"],\n requiredUpstreamStages: [\n \"scene-ray-projection\",\n \"lens-field-pupil-evaluation\",\n \"field-wavelength-psf\"\n ],\n coupledStages: [\"photosite-cfa-sampling\"],\n purpose:\n \"Evaluate time-dependent scene/camera mapping over exposure windows and reserve independent native-sensor readout scheduling for rolling/global capture.\"\n },\n {\n id: \"sensor-optical-stack\",\n domain: \"sensor-output-display\",\n status: \"reserved-contract\",\n coordinateSpaces: [\"native-sensor-physical\"],\n requiredUpstreamStages: [\"field-wavelength-psf\"],\n coupledStages: [\"photosite-cfa-sampling\"],\n purpose:\n \"Reserve optical low-pass filter, cover-glass, and microlens behavior before photosite/color sampling.\"\n },\n {\n id: \"photosite-cfa-sampling\",\n domain: \"sensor-output-display\",\n status: \"reserved-contract\",\n coordinateSpaces: [\"native-sensor-physical\", \"native-raster\"],\n requiredUpstreamStages: [\"sensor-optical-stack\"],\n coupledStages: [\"temporal-exposure-readout\"],\n purpose:\n \"Reserve photosite/CFA spatial sampling while keeping native sensor coordinates and readout timing explicit.\"\n },\n {\n id: \"sensor-charge-statistics\",\n domain: \"sensor-output-display\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"native-raster\"],\n requiredUpstreamStages: [\n \"photosite-cfa-sampling\",\n \"temporal-exposure-readout\"\n ],\n coupledStages: [],\n purpose:\n \"Reserve photon/electron integration and shot-statistics semantics separately from later electronic read noise.\"\n },\n {\n id: \"read-noise-conversion\",\n domain: \"sensor-output-display\",\n status: \"partial-foundation\",\n coordinateSpaces: [\"native-raster\"],\n requiredUpstreamStages: [\"sensor-charge-statistics\"],\n coupledStages: [],\n purpose:\n \"Reserve electronic read-noise and conversion behavior independently from photon shot statistics.\"\n },\n {\n id: \"adc-quantization\",\n domain: \"sensor-output-display\",\n status: \"reserved-contract\",\n coordinateSpaces: [\"native-raster\"],\n requiredUpstreamStages: [\"read-noise-conversion\"],\n coupledStages: [],\n purpose:\n \"Reserve analog-to-digital conversion, clipping, and quantization after sensor/electronic signal formation.\"\n },\n {\n id: \"reconstruction\",\n domain: \"sensor-output-display\",\n status: \"reserved-contract\",\n coordinateSpaces: [\"native-raster\"],\n requiredUpstreamStages: [\"adc-quantization\"],\n coupledStages: [],\n purpose:\n \"Reserve demosaic/remosaic, binning-aware reconstruction, pixel-shift combination, and related capture-mode processing.\"\n },\n {\n id: \"physical-orientation-transform\",\n domain: \"sensor-output-display\",\n status: \"existing-foundation\",\n coordinateSpaces: [\"native-raster\", \"oriented-capture-raster\"],\n requiredUpstreamStages: [\"reconstruction\"],\n coupledStages: [\"temporal-exposure-readout\"],\n purpose:\n \"Transform reconstructed native-raster coordinates into oriented capture coordinates without redefining native sensor/readout coordinates. The coordinate transform primitive already exists independently; this dependency reserves its full-pipeline placement.\"\n },\n {\n id: \"output-crop-resample\",\n domain: \"sensor-output-display\",\n status: \"existing-foundation\",\n coordinateSpaces: [\"oriented-capture-raster\", \"output-raster\"],\n requiredUpstreamStages: [\"physical-orientation-transform\"],\n coupledStages: [],\n purpose:\n \"Apply digital/output crop and resampling while preserving physical capture identity and explicit axis-aware scale.\"\n },\n {\n id: \"display-processing\",\n domain: \"sensor-output-display\",\n status: \"reserved-contract\",\n coordinateSpaces: [\"output-raster\", \"display\"],\n requiredUpstreamStages: [\"output-crop-resample\"],\n coupledStages: [],\n purpose:\n \"Reserve tone/display/output processing after camera-science geometry and sampling; this stage must not redefine upstream physical quantities.\"\n }\n] as const satisfies readonly ImageFormationStageContract[];\n\nconst EFFECT_PLACEMENTS = [\n {\n id: \"focus-breathing\",\n primaryStage: \"lens-field-pupil-evaluation\",\n coupledStages: [\"scene-ray-projection\"],\n note:\n \"Focus breathing changes projection/magnification and must not be implemented as post-output crop or display scaling.\"\n },\n {\n id: \"geometric-distortion\",\n primaryStage: \"lens-field-pupil-evaluation\",\n coupledStages: [],\n note: \"Distortion is a field-coordinate mapping, not a blur.\"\n },\n {\n id: \"lateral-chromatic-aberration\",\n primaryStage: \"lens-field-pupil-evaluation\",\n coupledStages: [\"field-wavelength-psf\"],\n note:\n \"Lateral CA is wavelength/channel-dependent field mapping; wavelength-aware PSF models may share the same spectral basis.\"\n },\n {\n id: \"illumination-vignetting\",\n primaryStage: \"lens-field-pupil-evaluation\",\n coupledStages: [],\n note:\n \"Illumination vignetting changes field-dependent throughput only and is distinct from pupil clipping.\"\n },\n {\n id: \"mechanical-vignetting\",\n primaryStage: \"lens-field-pupil-evaluation\",\n coupledStages: [\"field-wavelength-psf\"],\n note:\n \"Mechanical/pupil clipping changes both throughput and the effective pupil/PSF, including cat's-eye bokeh.\"\n },\n {\n id: \"non-circular-diffraction\",\n primaryStage: \"field-wavelength-psf\",\n coupledStages: [\"lens-field-pupil-evaluation\"],\n note:\n \"Non-circular diffraction consumes an explicit pupil representation; preserve the current circular Airy result as a separate model.\"\n },\n {\n id: \"field-curvature\",\n primaryStage: \"field-wavelength-psf\",\n coupledStages: [],\n note: \"Field curvature is field-dependent focus/PSF behavior, not geometric distortion.\"\n },\n {\n id: \"field-sharpness-falloff\",\n primaryStage: \"field-wavelength-psf\",\n coupledStages: [],\n note:\n \"Field sharpness must be represented through a defensible field-dependent PSF or related optical model, not a synthetic quality score.\"\n },\n {\n id: \"field-dependent-bokeh\",\n primaryStage: \"field-wavelength-psf\",\n coupledStages: [\"lens-field-pupil-evaluation\"],\n note:\n \"Field-dependent bokeh may depend on pupil clipping and field position; do not collapse it into aperture blade count alone.\"\n },\n {\n id: \"spatial-camera-rotation\",\n primaryStage: \"temporal-exposure-readout\",\n coupledStages: [\"scene-ray-projection\"],\n note:\n \"Rotation should be evaluable as a time-parameterized mapping; depth-dependent camera translation is outside the initial rotation model.\"\n },\n {\n id: \"rolling-readout\",\n primaryStage: \"temporal-exposure-readout\",\n coupledStages: [\"photosite-cfa-sampling\", \"physical-orientation-transform\"],\n note:\n \"Readout timing is native-sensor timing. Physical orientation changes how native scan direction maps to the scene but does not redefine native coordinates.\"\n },\n {\n id: \"photosite-cfa-sampling\",\n primaryStage: \"photosite-cfa-sampling\",\n coupledStages: [\"sensor-optical-stack\", \"temporal-exposure-readout\"],\n note:\n \"CFA/photosite sampling follows the sensor optical stack and participates in the declared exposure/readout schedule.\"\n },\n {\n id: \"photon-charge-statistics\",\n primaryStage: \"sensor-charge-statistics\",\n coupledStages: [],\n note:\n \"Photon/charge statistics remain separate from electronic read noise and require explicit radiometric prerequisites.\"\n },\n {\n id: \"read-noise-conversion\",\n primaryStage: \"read-noise-conversion\",\n coupledStages: [],\n note:\n \"Electronic read noise/conversion is downstream of charge formation and must not alter photon shot-noise semantics.\"\n },\n {\n id: \"demosaic-remosaic\",\n primaryStage: \"reconstruction\",\n coupledStages: [\"photosite-cfa-sampling\"],\n note:\n \"Reconstruction consumes declared capture-mode/CFA sampling rather than redefining the native photosite layout.\"\n }\n] as const satisfies readonly ImageFormationEffectPlacement[];\n\nconst TEMPORAL = {\n authoritativeTimeUnit: \"s\",\n origin: \"exposure-start\",\n normalizedTimeIsDerivedOnly: true,\n exposureDurationAndReadoutTimingAreIndependent: true,\n globalReadoutDoesNotImplyZeroMotionBlur: true,\n nativeReadoutDirectionRemainsNativeUnderOrientation: true,\n note:\n \"Time-parameterized optical/camera mapping should be evaluated in seconds from exposure start. A normalized [0,1] parameter may be derived for algorithms but is not the authoritative physical time. Rolling/global readout timing is separate from local exposure duration.\"\n} as const satisfies ImageFormationTemporalContract;\n\nconst RENDERER = {\n geometricWarpSampling: \"inverse-map-destination-to-source\",\n alphaRepresentation: \"premultiplied\",\n occlusionRule: \"preserve-depth-order-across-warps\",\n previewAndReferenceShareScientificContract: true,\n backendMayApproximateButNotRedefineSemantics: true,\n note:\n \"Renderer implementations may use bounded preview approximations or higher-fidelity reference evaluation, but both consume the same engine-owned parameters. Geometric warps should inverse-sample destination locations to avoid forward-warp holes, preserve premultiplied-alpha semantics, and must not reorder scene occlusion merely because a field warp is applied.\"\n} as const satisfies ImageFormationRendererContract;\n\nconst NOTES = [\n \"This contract defines scientific ownership, coordinate semantics, and dependency/coupling boundaries. It does not claim that reserved stages are implemented.\",\n \"The stage graph is a dependency/ownership graph, not a claim that every physical interaction can be evaluated as one independent serial post-process.\",\n \"Independent effects may be combined computationally only when the implementation documents mathematical equivalence and preserves the public stage/effect semantics.\",\n \"Generic/parametric virtual-lens models must remain explicitly generic until defensible calibrated data with compatible reuse rights exists.\",\n \"Scene radiance is distinct from source illumination metadata, photometric luminance anchors, sensor-plane irradiance, and RGB preview values. A later renderer/provider must explicitly evaluate outgoing spectral radiance before optics/sensor composition.\",\n \"The primary lens-throughput bridge converts validated outgoing spectral radiance to pre-sensor-stack spectral irradiance through declared pupil acceptance, exactly one optical-transmission path, and at most one declared field-throughput term. It does not apply sensor optical-stack/CFA/QE response, PSF energy redistribution, stray light, or an implicit distortion brightness correction.\"\n] as const;\n\n/**\n * Returns the image-formation contract: the order of stages and who owns each one.\n *\n * The result is descriptive metadata. It is not a renderer, and a listed stage is not\n * necessarily available yet.\n */\nexport function getImageFormationContract(): ImageFormationContract {\n return {\n version: IMAGE_FORMATION_CONTRACT_VERSION,\n domains: [...DOMAINS],\n coordinateSpaces: COORDINATE_SPACES.map((space) => ({ ...space })),\n stages: STAGES.map((stage) => ({\n ...stage,\n coordinateSpaces: [...stage.coordinateSpaces],\n requiredUpstreamStages: [...stage.requiredUpstreamStages],\n coupledStages: [...stage.coupledStages]\n })),\n effectPlacements: EFFECT_PLACEMENTS.map((effect) => ({\n ...effect,\n coupledStages: [...effect.coupledStages]\n })),\n temporal: { ...TEMPORAL },\n renderer: { ...RENDERER },\n notes: [...NOTES]\n };\n}\n"]}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Freezes an engine-owned, acyclic tree of plain records and arrays in place, visiting enumerable
|
|
4
|
-
* child values before their parent. Returns the same value. This internal helper does not validate or
|
|
5
|
-
* clone data. Callers must first parse their domain contract and copy any caller-owned references that
|
|
6
|
-
* need to remain mutable. Primitives pass through unchanged. Already-frozen parents are still
|
|
7
|
-
* traversed because a shallow freeze does not establish descendant immutability. Accessors, cyclic
|
|
8
|
-
* graphs, Maps, Sets and typed-array storage are outside this helper's contract. Do not use it as a
|
|
9
|
-
* general-purpose untrusted-input boundary.
|
|
2
|
+
* Internal helper that deep-freezes engine-owned results so callers cannot change them.
|
|
10
3
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
11
4
|
*/
|
|
12
5
|
/**
|
|
13
|
-
* Freezes an engine-owned, acyclic tree of plain records and arrays in place
|
|
14
|
-
*
|
|
6
|
+
* Freezes an engine-owned, acyclic tree of plain records and arrays in place and
|
|
7
|
+
* returns the same value. Children (enumerable values) are frozen before their parent.
|
|
15
8
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
9
|
+
* It does not validate or copy anything. Parse the domain input first, and copy any
|
|
10
|
+
* caller-owned objects that must stay mutable. Primitives pass through unchanged. A
|
|
11
|
+
* parent that is already frozen is still walked, because a shallow freeze says nothing
|
|
12
|
+
* about its children.
|
|
20
13
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* Not supported: accessors, cycles, Maps, Sets and typed-array storage. Do not use this
|
|
15
|
+
* as a general guard for untrusted input.
|
|
23
16
|
*/
|
|
24
17
|
export declare function freezeOwnedData<T>(value: T): T;
|
|
25
|
-
//# sourceMappingURL=owned-data.d.ts.map
|
package/dist/core/owned-data.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Freezes an engine-owned, acyclic tree of plain records and arrays in place, visiting enumerable
|
|
5
|
-
* child values before their parent. Returns the same value. This internal helper does not validate or
|
|
6
|
-
* clone data. Callers must first parse their domain contract and copy any caller-owned references that
|
|
7
|
-
* need to remain mutable. Primitives pass through unchanged. Already-frozen parents are still
|
|
8
|
-
* traversed because a shallow freeze does not establish descendant immutability. Accessors, cyclic
|
|
9
|
-
* graphs, Maps, Sets and typed-array storage are outside this helper's contract. Do not use it as a
|
|
10
|
-
* general-purpose untrusted-input boundary.
|
|
3
|
+
* Internal helper that deep-freezes engine-owned results so callers cannot change them.
|
|
11
4
|
* @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.
|
|
12
5
|
*/
|
|
13
6
|
/**
|
|
14
|
-
* Freezes an engine-owned, acyclic tree of plain records and arrays in place
|
|
15
|
-
*
|
|
7
|
+
* Freezes an engine-owned, acyclic tree of plain records and arrays in place and
|
|
8
|
+
* returns the same value. Children (enumerable values) are frozen before their parent.
|
|
16
9
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
10
|
+
* It does not validate or copy anything. Parse the domain input first, and copy any
|
|
11
|
+
* caller-owned objects that must stay mutable. Primitives pass through unchanged. A
|
|
12
|
+
* parent that is already frozen is still walked, because a shallow freeze says nothing
|
|
13
|
+
* about its children.
|
|
21
14
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
15
|
+
* Not supported: accessors, cycles, Maps, Sets and typed-array storage. Do not use this
|
|
16
|
+
* as a general guard for untrusted input.
|
|
24
17
|
*/
|
|
25
18
|
export function freezeOwnedData(value) {
|
|
26
19
|
if (value !== null && typeof value === "object") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owned-data.js","sourceRoot":"","sources":["../../src/core/owned-data.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"owned-data.js","sourceRoot":"","sources":["../../src/core/owned-data.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;GAGG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAI,KAAQ;IACzC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACzC,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Internal helper that deep-freezes engine-owned results so callers cannot change them.\n * @see docs/API_STYLE.md for equations, coordinate/unit conventions, blockers and support limits.\n */\n\n/**\n * Freezes an engine-owned, acyclic tree of plain records and arrays in place and\n * returns the same value. Children (enumerable values) are frozen before their parent.\n *\n * It does not validate or copy anything. Parse the domain input first, and copy any\n * caller-owned objects that must stay mutable. Primitives pass through unchanged. A\n * parent that is already frozen is still walked, because a shallow freeze says nothing\n * about its children.\n *\n * Not supported: accessors, cycles, Maps, Sets and typed-array storage. Do not use this\n * as a general guard for untrusted input.\n */\nexport function freezeOwnedData<T>(value: T): T {\n if (value !== null && typeof value === \"object\") {\n for (const child of Object.values(value)) {\n freezeOwnedData(child);\n }\n Object.freeze(value);\n }\n return value;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Euclidean norm (vector length) of the components. Unlike `Math.hypot`, it uses only correctly
|
|
3
|
+
* rounded IEEE operations, so the result is bit-identical in every JavaScript engine.
|
|
4
|
+
*
|
|
5
|
+
* Components are summed in argument order. Inputs far from 1 are first rescaled by an exact power
|
|
6
|
+
* of two, so squaring cannot overflow or underflow. Non-finite input gives a non-finite result;
|
|
7
|
+
* callers validate inputs first.
|
|
8
|
+
*/
|
|
9
|
+
export declare function portableHypot(...values: readonly number[]): number;
|
|
10
|
+
/**
|
|
11
|
+
* True when two finite numbers differ by at most `maximumUlps` ULPs (units in the last place).
|
|
12
|
+
* One ULP here is `Number.EPSILON` times the larger magnitude. Use it to accept an archived value
|
|
13
|
+
* that another engine or an earlier release computed with an implementation-approximated function.
|
|
14
|
+
*/
|
|
15
|
+
export declare function equalWithinUlps(a: number, b: number, maximumUlps: number): boolean;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Floating-point helpers that give bit-identical results in every JavaScript engine.
|
|
4
|
+
*
|
|
5
|
+
* ECMAScript requires `+ - * /` and `Math.sqrt` to be correctly rounded IEEE 754 binary64
|
|
6
|
+
* (double-precision) operations. A fixed sequence of them gives the same bits in every
|
|
7
|
+
* conforming engine. `Math.hypot`, `Math.exp`, `Math.atan`, `Math.cos` and the other
|
|
8
|
+
* transcendental functions are "implementation-approximated" (ECMA-262 §21.3.2). They can
|
|
9
|
+
* differ in the last bit between V8, JavaScriptCore and SpiderMonkey.
|
|
10
|
+
*
|
|
11
|
+
* So any value that is stored and later recomputed for an exact identity check must use
|
|
12
|
+
* only the correctly rounded operations.
|
|
13
|
+
* @see docs/NUMERICAL_CORRECTNESS.md §Cross-engine determinism
|
|
14
|
+
*/
|
|
15
|
+
const LARGE = 2 ** 500;
|
|
16
|
+
const SMALL = 2 ** -500;
|
|
17
|
+
const SCALE_DOWN = 2 ** -600;
|
|
18
|
+
const SCALE_UP = 2 ** 600;
|
|
19
|
+
/**
|
|
20
|
+
* Euclidean norm (vector length) of the components. Unlike `Math.hypot`, it uses only correctly
|
|
21
|
+
* rounded IEEE operations, so the result is bit-identical in every JavaScript engine.
|
|
22
|
+
*
|
|
23
|
+
* Components are summed in argument order. Inputs far from 1 are first rescaled by an exact power
|
|
24
|
+
* of two, so squaring cannot overflow or underflow. Non-finite input gives a non-finite result;
|
|
25
|
+
* callers validate inputs first.
|
|
26
|
+
*/
|
|
27
|
+
export function portableHypot(...values) {
|
|
28
|
+
let maximum = 0;
|
|
29
|
+
for (const value of values) {
|
|
30
|
+
const magnitude = Math.abs(value);
|
|
31
|
+
if (!(magnitude <= maximum))
|
|
32
|
+
maximum = magnitude;
|
|
33
|
+
}
|
|
34
|
+
if (maximum === 0 || !Number.isFinite(maximum))
|
|
35
|
+
return maximum;
|
|
36
|
+
const scale = maximum > LARGE ? SCALE_DOWN : maximum < SMALL ? SCALE_UP : 1;
|
|
37
|
+
let sum = 0;
|
|
38
|
+
for (const value of values) {
|
|
39
|
+
const scaled = value * scale;
|
|
40
|
+
sum += scaled * scaled;
|
|
41
|
+
}
|
|
42
|
+
return Math.sqrt(sum) / scale;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* True when two finite numbers differ by at most `maximumUlps` ULPs (units in the last place).
|
|
46
|
+
* One ULP here is `Number.EPSILON` times the larger magnitude. Use it to accept an archived value
|
|
47
|
+
* that another engine or an earlier release computed with an implementation-approximated function.
|
|
48
|
+
*/
|
|
49
|
+
export function equalWithinUlps(a, b, maximumUlps) {
|
|
50
|
+
if (!Number.isFinite(a) || !Number.isFinite(b))
|
|
51
|
+
return false;
|
|
52
|
+
if (a === b)
|
|
53
|
+
return true;
|
|
54
|
+
return Math.abs(a - b) <= maximumUlps * Number.EPSILON * Math.max(Math.abs(a), Math.abs(b));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=portable-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable-math.js","sourceRoot":"","sources":["../../src/core/portable-math.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;GAYG;AAEH,MAAM,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC;AACvB,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AAC7B,MAAM,QAAQ,GAAG,CAAC,IAAI,GAAG,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,MAAyB;IACxD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC;YAAE,OAAO,GAAG,SAAS,CAAC;IACnD,CAAC;IACD,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC/D,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;QAC7B,GAAG,IAAI,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,WAAmB;IACvE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7D,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Floating-point helpers that give bit-identical results in every JavaScript engine.\n *\n * ECMAScript requires `+ - * /` and `Math.sqrt` to be correctly rounded IEEE 754 binary64\n * (double-precision) operations. A fixed sequence of them gives the same bits in every\n * conforming engine. `Math.hypot`, `Math.exp`, `Math.atan`, `Math.cos` and the other\n * transcendental functions are \"implementation-approximated\" (ECMA-262 §21.3.2). They can\n * differ in the last bit between V8, JavaScriptCore and SpiderMonkey.\n *\n * So any value that is stored and later recomputed for an exact identity check must use\n * only the correctly rounded operations.\n * @see docs/NUMERICAL_CORRECTNESS.md §Cross-engine determinism\n */\n\nconst LARGE = 2 ** 500;\nconst SMALL = 2 ** -500;\nconst SCALE_DOWN = 2 ** -600;\nconst SCALE_UP = 2 ** 600;\n\n/**\n * Euclidean norm (vector length) of the components. Unlike `Math.hypot`, it uses only correctly\n * rounded IEEE operations, so the result is bit-identical in every JavaScript engine.\n *\n * Components are summed in argument order. Inputs far from 1 are first rescaled by an exact power\n * of two, so squaring cannot overflow or underflow. Non-finite input gives a non-finite result;\n * callers validate inputs first.\n */\nexport function portableHypot(...values: readonly number[]): number {\n let maximum = 0;\n for (const value of values) {\n const magnitude = Math.abs(value);\n if (!(magnitude <= maximum)) maximum = magnitude;\n }\n if (maximum === 0 || !Number.isFinite(maximum)) return maximum;\n const scale = maximum > LARGE ? SCALE_DOWN : maximum < SMALL ? SCALE_UP : 1;\n let sum = 0;\n for (const value of values) {\n const scaled = value * scale;\n sum += scaled * scaled;\n }\n return Math.sqrt(sum) / scale;\n}\n\n/**\n * True when two finite numbers differ by at most `maximumUlps` ULPs (units in the last place).\n * One ULP here is `Number.EPSILON` times the larger magnitude. Use it to accept an archived value\n * that another engine or an earlier release computed with an implementation-approximated function.\n */\nexport function equalWithinUlps(a: number, b: number, maximumUlps: number): boolean {\n if (!Number.isFinite(a) || !Number.isFinite(b)) return false;\n if (a === b) return true;\n return Math.abs(a - b) <= maximumUlps * Number.EPSILON * Math.max(Math.abs(a), Math.abs(b));\n}\n"]}
|