@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-to-sensor-quadrature.js","sourceRoot":"","sources":["../../src/optics/scene-to-sensor-quadrature.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAA0B,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAC3E,mCAAmC,EAAE,kCAAkC,EACvE,uCAAuC,EAAqD,MAAM,6BAA6B,CAAC;AAClI,OAAO,EAAE,+BAA+B,EAAE,oCAAoC,EACW,MAAM,wCAAwC,CAAC;AACxI,OAAO,EAAE,sCAAsC,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,wCAAwC,EAAsD,MAAM,iCAAiC,CAAC;AA8C/I;;;;;GAKG;AACH,MAAM,UAAU,0CAA0C,CACxD,KAAsD;IAEtD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,4BAA4B,CAAC,IAAI,KAAK,CAAC,4BAA4B,GAAG,CAAC,EAAE,CAAC;QACnG,MAAM,IAAI,2BAA2B,CAAC,wDAAwD,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,KAAK,GAAG,+BAA+B,CAAC,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC3G,MAAM,a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// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Runs the existing paraxial scene-to-sensor optical bridge at every requested sample node.\n *\n * Before it returns physical samples in W/m²/nm, it checks that the node identities, grid coverage\n * and provider bindings match exactly. Image coordinates come from the spatial plan, so a caller\n * cannot attach a field-throughput result computed at a different point.\n * @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers\n * and support limits.\n */\n\nimport { approximationResult, type CalculationResult } from \"../core/calculation-result.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport { parseSceneIlluminationProfile } from \"../schema/illumination.js\";\nimport { parseSceneIlluminationTemporalProfile } from \"../schema/illumination-temporal.js\";\nimport { parseSceneMaterialResponseProfile, parseSceneRadianceProviderProfile,\n parseSceneRadianceEvaluationRequest, parseSceneRadianceEvaluationResult,\n validateSceneRadianceEvaluationBindings, type ValidateSceneRadianceEvaluationBindingsInput } from \"../schema/scene-radiance.js\";\nimport { bindSensorSpatioSpectralSamples, reduceSensorSpatioSpectralIrradiance,\n type ReduceSensorSpatioSpectralIrradianceInput, type SensorSpatioSpectralNodeIdentity } from \"../sensor/spatio-spectral-reduction.js\";\nimport { sensorSpatialQuadratureNodeIdentityKey } from \"../sensor/spatial-sample-reduction.js\";\nimport { calculateSceneRadianceToSensorIrradiance, type CalculateSceneRadianceToSensorIrradianceInput } from \"./scene-to-sensor-irradiance.js\";\nimport { requireInputKeys } from \"../core/record-validation.js\";\n\n/**\n * One declared scene query and its result, for one exact spatial and wavelength node before the\n * anti-aliasing (AA) filter.\n */\nexport interface SceneSensorQuadratureSample {\n node: SensorSpatioSpectralNodeIdentity;\n sceneRadianceRequest: CalculateSceneRadianceToSensorIrradianceInput[\"sceneRadianceRequest\"];\n sceneRadianceResult: CalculateSceneRadianceToSensorIrradianceInput[\"sceneRadianceResult\"];\n fieldThroughput: CalculateSceneRadianceToSensorIrradianceInput[\"fieldThroughput\"];\n}\n\n/** Static point-sample bridge. PSF blur and motion over time are handled elsewhere. */\nexport interface CalculateSceneToSensorIrradianceQuadratureInput {\n spatialQuadrature: ReduceSensorSpatioSpectralIrradianceInput[\"spatialQuadrature\"];\n spectralQuadrature: ReduceSensorSpatioSpectralIrradianceInput[\"spectralQuadrature\"];\n /** Provider, illumination and material identities with their evidence. Parsed before use. */\n sceneBindings: Omit<ValidateSceneRadianceEvaluationBindingsInput, \"request\" | \"result\">;\n /** One declared lens/focus/filter state shared by every node. */\n optics: Omit<CalculateSceneRadianceToSensorIrradianceInput,\n \"sceneRadianceRequest\" | \"sceneRadianceResult\" | \"imagePointMm\" | \"fieldThroughput\">;\n /** One non-negative instant shared by all queries. This is not an integral over the exposure. */\n timeSecondsFromExposureStart: number;\n /** Every combination of the grid axes, with a unique scene sampleId per node. */\n samples: readonly SceneSensorQuadratureSample[];\n}\n\nexport interface SceneToSensorIrradianceQuadrature {\n sourcePlane: \"sensor-package-incident\";\n outputMeaning: \"pre-sensor-stack-pre-aa-irradiance-quadrature\";\n sourceTargetProjectionVerified: false;\n sceneProviderExecutionVerified: false;\n psfRedistributionApplied: false;\n temporalIntegrationApplied: false;\n irradianceSamples: ReduceSensorSpatioSpectralIrradianceInput[\"sampleValues\"];\n reduction: ReturnType<typeof reduceSensorSpatioSpectralIrradiance>;\n samples: readonly {\n node: SensorSpatioSpectralNodeIdentity;\n /** Physical source coordinate, in mm, before the anti-aliasing filter spreads it. */\n preAntiAliasingSourcePointMm: { x: number; y: number };\n /** The provider's declared target and time. This is not a verified ray intersection. */\n request: SceneSensorQuadratureSample[\"sceneRadianceRequest\"];\n result: SceneSensorQuadratureSample[\"sceneRadianceResult\"];\n bindings: ReturnType<typeof validateSceneRadianceEvaluationBindings>;\n optics: ReturnType<typeof calculateSceneRadianceToSensorIrradiance>;\n }[];\n}\n\n/**\n * Runs the existing paraxial optical bridge at every requested node.\n *\n * Before it returns physical W/m²/nm samples, it checks that node identities,\n * grid coverage and provider bindings match exactly. Image coordinates come\n * from the spatial plan, so a caller cannot attach a field-throughput result\n * computed at a different point.\n */\nexport function calculateSceneToSensorIrradianceQuadrature(\n input: CalculateSceneToSensorIrradianceQuadratureInput\n): CalculationResult<SceneToSensorIrradianceQuadrature> {\n requireInputKeys(input, \"calculateSceneToSensorIrradianceQuadrature\", [\"spatialQuadrature\", \"spectralQuadrature\", \"sceneBindings\", \"optics\", \"timeSecondsFromExposureStart\", \"samples\"]);\n if (!Number.isFinite(input.timeSecondsFromExposureStart) || input.timeSecondsFromExposureStart < 0) {\n throw new InvalidScientificInputError(\"Quadrature sample time must be finite and nonnegative.\");\n }\n const bound = bindSensorSpatioSpectralSamples({ ...input, sampleValues: input.samples }, sample => sample);\n const sceneBindings = {\n providerProfile: parseSceneRadianceProviderProfile(input.sceneBindings.providerProfile),\n illuminationProfile: parseSceneIlluminationProfile(input.sceneBindings.illuminationProfile),\n materialResponseProfile: parseSceneMaterialResponseProfile(input.sceneBindings.materialResponseProfile),\n ...(input.sceneBindings.illuminationTemporalProfile === undefined ? {} : {\n illuminationTemporalProfile: parseSceneIlluminationTemporalProfile(input.sceneBindings.illuminationTemporalProfile)\n })\n };\n if (sceneBindings.providerProfile.fidelity.spectral !== \"wavelength-resolved\") {\n throw new InvalidScientificInputError(\"Physical irradiance quadrature requires wavelength-resolved provider fidelity.\");\n }\n const samples: SceneToSensorIrradianceQuadrature[\"samples\"][number][] = [];\n const irradianceSamples: ReduceSensorSpatioSpectralIrradianceInput[\"sampleValues\"][number][] = [];\n const sampleIds = new Set<string>();\n // Sort into the plan's canonical order so shuffled input gives the same diagnostics.\n for (const spectral of input.spectralQuadrature.nodes) {\n for (const spatial of input.spatialQuadrature.nodes) {\n const spatialNode = { antiAliasingComponentIndex: spatial.antiAliasingComponentIndex,\n apertureSampleXIndex: spatial.apertureSampleXIndex, apertureSampleYIndex: spatial.apertureSampleYIndex };\n const key = sensorSpatialQuadratureNodeIdentityKey(spatialNode) + \"|\" + spectral.spectralSampleIndex;\n const sample = bound.valuesByKey.get(key)!;\n const request = parseSceneRadianceEvaluationRequest(sample.sceneRadianceRequest);\n const result = parseSceneRadianceEvaluationResult(sample.sceneRadianceResult);\n if (request.wavelengthNanometers !== spectral.wavelengthNanometers ||\n request.wavelengthBasis !== input.spectralQuadrature.wavelengthBasis ||\n request.timeSecondsFromExposureStart !== input.timeSecondsFromExposureStart) {\n throw new InvalidScientificInputError(\"Scene request must match its exact quadrature wavelength, basis and time.\");\n }\n if (sampleIds.has(request.sampleId)) {\n throw new InvalidScientificInputError(\"Each quadrature node requires its own scene sampleId.\");\n }\n sampleIds.add(request.sampleId);\n const bindings = validateSceneRadianceEvaluationBindings({ ...sceneBindings, request, result });\n const optics = calculateSceneRadianceToSensorIrradiance({ ...input.optics,\n sceneRadianceRequest: request, sceneRadianceResult: result,\n imagePointMm: spatial.preAntiAliasingSourcePointMm, fieldThroughput: sample.fieldThroughput });\n const node = { spatialNode, spectralSampleIndex: spectral.spectralSampleIndex,\n wavelengthNanometers: spectral.wavelengthNanometers };\n samples.push({ node, preAntiAliasingSourcePointMm: { ...spatial.preAntiAliasingSourcePointMm }, request, result, bindings, optics });\n irradianceSamples.push({ node, spectralIrradianceWattsPerSquareMeterPerNanometer:\n optics.value.sensorPlaneSpectralIrradianceWattsPerSquareMeterNanometer });\n }\n }\n const reduction = reduceSensorSpatioSpectralIrradiance({ spatialQuadrature: input.spatialQuadrature,\n spectralQuadrature: input.spectralQuadrature, sampleValues: irradianceSamples });\n return approximationResult({ sourcePlane: \"sensor-package-incident\",\n outputMeaning: \"pre-sensor-stack-pre-aa-irradiance-quadrature\", sourceTargetProjectionVerified: false,\n sceneProviderExecutionVerified: false, psfRedistributionApplied: false, temporalIntegrationApplied: false,\n irradianceSamples, reduction, samples }, \"scene-to-sensor-irradiance-quadrature\", \"0.1.0\", [\n \"Scene targets and provider radiance remain declared approximations; projection/transport are not verified.\",\n \"Paraxial optics is evaluated once per pre-AA node; PSF redistribution and exposure integration are not applied.\",\n \"Output is sensor-package-incident; downstream response scope must match that plane.\"\n ]);\n}\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Ideal rays through a symmetric thin-lens pupil. This module does not intersect rays with the
|
|
3
|
+
* scene and does no radiometry.
|
|
4
|
+
*/
|
|
2
5
|
import { type CalculationResult } from "../core/calculation-result.js";
|
|
3
6
|
import { type EvidenceProvenance } from "../core/evidence-provenance.js";
|
|
4
|
-
import { type FocusPlane } from "./focus-state.js";
|
|
7
|
+
import { parseFocusPlane, type FocusPlane } from "./focus-state.js";
|
|
5
8
|
import { type CameraAngularVelocityRadPerSec } from "../motion/camera-rotation.js";
|
|
6
9
|
export interface IdealCircularPupil {
|
|
7
10
|
kind: "ideal-uniform-circular-pupil";
|
|
@@ -51,6 +54,19 @@ export interface SensorApertureRays {
|
|
|
51
54
|
radiometryCalculated: false;
|
|
52
55
|
apertureAreaApplied: false;
|
|
53
56
|
}
|
|
54
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Polar midpoint rule with equal-area cells. Weights are normalized as an average, so they never
|
|
59
|
+
* apply the f-number a second time.
|
|
60
|
+
*/
|
|
55
61
|
export declare function calculateSensorApertureRays(input: CalculateSensorApertureRaysInput): CalculationResult<SensorApertureRays>;
|
|
56
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Internal (2.0 performance): the rays of calculateSensorApertureRays, by the same code, for a pupil and focus it has
|
|
64
|
+
* already validated and parsed. The lean native executor calls it per site after one full validation per template.
|
|
65
|
+
* It still runs the rotation, time, image-distance and forward-hemisphere checks, and throws where the full function
|
|
66
|
+
* would. Not exported from the package.
|
|
67
|
+
*/
|
|
68
|
+
export declare function sensorApertureRayValues(owned: Pick<CalculateSensorApertureRaysInput, "sourcePointNativeSensorMm" | "focalLengthMm" | "nominalFNumber" | "angularVelocityRadPerSec" | "timeSecondsFromOpeningReference">, pupil: Pick<IdealCircularPupil, "radialSampleCount" | "angularSampleCount">, focus: ReturnType<typeof parseFocusPlane>): {
|
|
69
|
+
rays: SensorApertureRay[];
|
|
70
|
+
v: number;
|
|
71
|
+
radius: number;
|
|
72
|
+
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Ideal rays through a symmetric thin-lens pupil. This module does not intersect rays with the
|
|
4
|
+
* scene and does no radiometry.
|
|
5
|
+
*/
|
|
3
6
|
import { approximationResult } from "../core/calculation-result.js";
|
|
4
7
|
import { parseEvidenceList } from "../core/evidence-provenance.js";
|
|
5
8
|
import { InvalidScientificInputError, requirePositiveFinite } from "../core/validation.js";
|
|
6
9
|
import { calculateFocusPlaneImageDistance, parseFocusPlane } from "./focus-state.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
10
|
+
import { applyPhysicalCameraRotation, calculateInverseCameraRotationImageMapping } from "../motion/camera-rotation.js";
|
|
11
|
+
import { requireInputKeys } from "../core/record-validation.js";
|
|
12
|
+
/**
|
|
13
|
+
* Polar midpoint rule with equal-area cells. Weights are normalized as an average, so they never
|
|
14
|
+
* apply the f-number a second time.
|
|
15
|
+
*/
|
|
9
16
|
export function calculateSensorApertureRays(input) {
|
|
17
|
+
requireInputKeys(input, "calculateSensorApertureRays", ["sourcePointNativeSensorMm", "focalLengthMm", "nominalFNumber", "focus", "pupil", "angularVelocityRadPerSec", "timeSecondsFromOpeningReference"]);
|
|
10
18
|
const owned = structuredClone(input), pupil = owned.pupil;
|
|
11
19
|
requirePositiveFinite("nominalFNumber", owned.nominalFNumber);
|
|
12
20
|
if (!pupil || pupil.kind !== "ideal-uniform-circular-pupil" ||
|
|
@@ -17,14 +25,29 @@ export function calculateSensorApertureRays(input) {
|
|
|
17
25
|
}
|
|
18
26
|
pupil.evidence = parseEvidenceList(pupil.evidence, "circularPupil.evidence");
|
|
19
27
|
const focus = parseFocusPlane(owned.focus);
|
|
28
|
+
const { rays, v, radius } = sensorApertureRayValues(owned, pupil, focus);
|
|
29
|
+
return approximationResult({ rays, projectionDistanceMm: v, pupilRadiusMm: radius, focus, pupil,
|
|
30
|
+
sceneVisibilityCalculated: false, radiometryCalculated: false, apertureAreaApplied: false }, "ideal-thin-lens-circular-pupil-rays", "0.1.0", [
|
|
31
|
+
"Ideal symmetric paraxial thin lens, unity pupil magnification and uniform circular pupil; no diffraction, aberrations, lens housing or pupil clipping.",
|
|
32
|
+
"Normalized pupil averaging is separate from the existing working-f-number radiometric factor; no aperture area or solid-angle factor is applied here.",
|
|
33
|
+
"Pure camera rotation about the lens principal-plane origin; no translation or depth-dependent camera motion.",
|
|
34
|
+
"Finite polar midpoint quadrature does not establish scene visibility, transport calibration or convergence."
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Internal (2.0 performance): the rays of calculateSensorApertureRays, by the same code, for a pupil and focus it has
|
|
39
|
+
* already validated and parsed. The lean native executor calls it per site after one full validation per template.
|
|
40
|
+
* It still runs the rotation, time, image-distance and forward-hemisphere checks, and throws where the full function
|
|
41
|
+
* would. Not exported from the package.
|
|
42
|
+
*/
|
|
43
|
+
export function sensorApertureRayValues(owned, pupil, focus) {
|
|
20
44
|
const v = calculateFocusPlaneImageDistance({ focalLengthMm: owned.focalLengthMm, focus }).value.imageDistanceMm;
|
|
21
|
-
// Reuse the
|
|
45
|
+
// Reuse the existing rotation and time validation, and the check that rays point forward.
|
|
22
46
|
const inverse = calculateInverseCameraRotationImageMapping({ focalLengthMm: owned.focalLengthMm,
|
|
23
47
|
imagePointMm: { x: owned.sourcePointNativeSensorMm.x, y: -owned.sourcePointNativeSensorMm.y },
|
|
24
48
|
angularVelocityRadPerSec: owned.angularVelocityRadPerSec, timeSecondsFromExposureStart: owned.timeSecondsFromOpeningReference,
|
|
25
49
|
...(focus.kind === "finite" ? { focusDistanceM: focus.distanceM } : {}) }).value;
|
|
26
|
-
const displacement = inverse.angularDisplacementRad
|
|
27
|
-
const axis = angle === 0 ? { x: 0, y: 0, z: 1 } : { x: displacement.pitch / angle, y: displacement.yaw / angle, z: displacement.roll / angle };
|
|
50
|
+
const displacement = inverse.angularDisplacementRad;
|
|
28
51
|
const radius = owned.focalLengthMm / (2 * owned.nominalFNumber), count = pupil.radialSampleCount * pupil.angularSampleCount;
|
|
29
52
|
if (!Number.isFinite(radius) || radius <= 0)
|
|
30
53
|
throw new InvalidScientificInputError("Pupil radius must remain positive and finite.");
|
|
@@ -38,18 +61,13 @@ export function calculateSensorApertureRays(input) {
|
|
|
38
61
|
: { x, y, z: 1 };
|
|
39
62
|
const length = Math.hypot(direction.x, direction.y, direction.z);
|
|
40
63
|
const unit = { x: direction.x / length, y: direction.y / length, z: direction.z / length };
|
|
41
|
-
|
|
64
|
+
// Same physical right-hand camera rotation as the inverse mapping above.
|
|
65
|
+
const rotatedOrigin = applyPhysicalCameraRotation(origin, displacement, "camera-to-reference"), rotatedDirection = applyPhysicalCameraRotation(unit, displacement, "camera-to-reference");
|
|
42
66
|
if (![...Object.values(rotatedOrigin), ...Object.values(rotatedDirection)].every(Number.isFinite) || rotatedDirection.z <= 0) {
|
|
43
67
|
throw new InvalidScientificInputError("A pupil ray leaves the supported forward hemisphere or finite coordinate domain.");
|
|
44
68
|
}
|
|
45
69
|
return { originM: rotatedOrigin, directionUnitVector: rotatedDirection, pupilPointMm: point, weight: 1 / count, pupilSampleIndex: i };
|
|
46
70
|
});
|
|
47
|
-
return
|
|
48
|
-
sceneVisibilityCalculated: false, radiometryCalculated: false, apertureAreaApplied: false }, "ideal-thin-lens-circular-pupil-rays", "0.1.0", [
|
|
49
|
-
"Ideal symmetric paraxial thin lens, unity pupil magnification and uniform circular pupil; no diffraction, aberrations, lens housing or pupil clipping.",
|
|
50
|
-
"Normalized pupil averaging is separate from the existing working-f-number radiometric factor; no aperture area or solid-angle factor is applied here.",
|
|
51
|
-
"Pure camera rotation about the lens principal-plane origin; no translation or depth-dependent camera motion.",
|
|
52
|
-
"Finite polar midpoint quadrature does not establish scene visibility, transport calibration or convergence."
|
|
53
|
-
]);
|
|
71
|
+
return { rays, v, radius };
|
|
54
72
|
}
|
|
55
73
|
//# sourceMappingURL=sensor-aperture-rays.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensor-aperture-rays.js","sourceRoot":"","sources":["../../src/optics/sensor-aperture-rays.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8FAA8F;AAC9F,OAAO,EAAE,mBAAmB,EAA0B,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAA2B,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,gCAAgC,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,0CAA0C,EAAE,uBAAuB,EACrC,MAAM,8BAA8B,CAAC;AAmC5E,kGAAkG;AAClG,MAAM,UAAU,2BAA2B,CAAC,KAAuC;IACjF,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1D,qBAAqB,CAAC,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,8BAA8B;QACzD,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,EAAE;QAC7G,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,KAAK,CAAC,kBAAkB,GAAG,CAAC,IAAI,KAAK,CAAC,kBAAkB,GAAG,EAAE;QAChH,KAAK,CAAC,iBAAiB,GAAC,KAAK,CAAC,kBAAkB,GAAG,GAAG,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAA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,GAAC,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,GAAC,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,GAAC,MAAM,EAAE,CAAC;QACrF,yEAAyE;QACzE,MAAM,aAAa,GAAG,2BAA2B,CAAC,MAAM,EAAE,YAAY,EAAE,qBAAqB,CAAC,EAC5F,gBAAgB,GAAG,2BAA2B,CAAC,IAAI,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC;QAC5F,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5H,MAAM,IAAI,2BAA2B,CAAC,kFAAkF,CAAC,CAAC;QAC5H,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtI,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n/**\n * Ideal rays through a symmetric thin-lens pupil. This module does not intersect rays with the\n * scene and does no radiometry.\n */\nimport { approximationResult, type CalculationResult } from \"../core/calculation-result.js\";\nimport { parseEvidenceList, type EvidenceProvenance } from \"../core/evidence-provenance.js\";\nimport { InvalidScientificInputError, requirePositiveFinite } from \"../core/validation.js\";\nimport { calculateFocusPlaneImageDistance, parseFocusPlane, type FocusPlane } from \"./focus-state.js\";\nimport { applyPhysicalCameraRotation, calculateInverseCameraRotationImageMapping,\n type CameraAngularVelocityRadPerSec } from \"../motion/camera-rotation.js\";\nimport { requireInputKeys } from \"../core/record-validation.js\";\nexport interface IdealCircularPupil {\n kind: \"ideal-uniform-circular-pupil\";\n radialSampleCount: number;\n angularSampleCount: number;\n evidence: readonly EvidenceProvenance[];\n limitation: string;\n}\nexport interface SensorApertureRay {\n /** Lens principal-plane origin and look direction in exposure-opening camera axes. */\n originM: { x: number; y: number; z: number };\n directionUnitVector: { x: number; y: number; z: number };\n pupilPointMm: { x: number; y: number };\n weight: number;\n pupilSampleIndex: number;\n}\nexport interface CalculateSensorApertureRaysInput {\n sourcePointNativeSensorMm: { x: number; y: number };\n focalLengthMm: number;\n nominalFNumber: number;\n focus: FocusPlane;\n pupil: IdealCircularPupil;\n angularVelocityRadPerSec: CameraAngularVelocityRadPerSec;\n timeSecondsFromOpeningReference: number;\n}\nexport interface SensorApertureRays {\n rays: readonly SensorApertureRay[];\n projectionDistanceMm: number;\n pupilRadiusMm: number;\n focus: FocusPlane;\n pupil: IdealCircularPupil;\n sceneVisibilityCalculated: false;\n radiometryCalculated: false;\n apertureAreaApplied: false;\n}\n/**\n * Polar midpoint rule with equal-area cells. Weights are normalized as an average, so they never\n * apply the f-number a second time.\n */\nexport function calculateSensorApertureRays(input: CalculateSensorApertureRaysInput): CalculationResult<SensorApertureRays> {\n requireInputKeys(input, \"calculateSensorApertureRays\", [\"sourcePointNativeSensorMm\", \"focalLengthMm\", \"nominalFNumber\", \"focus\", \"pupil\", \"angularVelocityRadPerSec\", \"timeSecondsFromOpeningReference\"]);\n const owned = structuredClone(input), pupil = owned.pupil;\n requirePositiveFinite(\"nominalFNumber\", owned.nominalFNumber);\n if (!pupil || pupil.kind !== \"ideal-uniform-circular-pupil\" ||\n !Number.isSafeInteger(pupil.radialSampleCount) || pupil.radialSampleCount < 1 || pupil.radialSampleCount > 32 ||\n !Number.isSafeInteger(pupil.angularSampleCount) || pupil.angularSampleCount < 4 || pupil.angularSampleCount > 64 ||\n pupil.radialSampleCount*pupil.angularSampleCount > 256 || typeof pupil.limitation !== \"string\" || !pupil.limitation.trim()) {\n throw new InvalidScientificInputError(\"Circular pupil requires 1..32 radial, 4..64 angular midpoints, at most 256 rays and explicit limitations.\");\n }\n pupil.evidence = parseEvidenceList(pupil.evidence, \"circularPupil.evidence\");\n const focus = parseFocusPlane(owned.focus);\n const { rays, v, radius } = sensorApertureRayValues(owned, pupil, focus);\n return approximationResult({ rays, projectionDistanceMm: v, pupilRadiusMm: radius, focus, pupil,\n sceneVisibilityCalculated: false, radiometryCalculated: false, apertureAreaApplied: false }, \"ideal-thin-lens-circular-pupil-rays\", \"0.1.0\", [\n \"Ideal symmetric paraxial thin lens, unity pupil magnification and uniform circular pupil; no diffraction, aberrations, lens housing or pupil clipping.\",\n \"Normalized pupil averaging is separate from the existing working-f-number radiometric factor; no aperture area or solid-angle factor is applied here.\",\n \"Pure camera rotation about the lens principal-plane origin; no translation or depth-dependent camera motion.\",\n \"Finite polar midpoint quadrature does not establish scene visibility, transport calibration or convergence.\"\n ]);\n}\n\n/**\n * Internal (2.0 performance): the rays of calculateSensorApertureRays, by the same code, for a pupil and focus it has\n * already validated and parsed. The lean native executor calls it per site after one full validation per template.\n * It still runs the rotation, time, image-distance and forward-hemisphere checks, and throws where the full function\n * would. Not exported from the package.\n */\nexport function sensorApertureRayValues(owned: Pick<CalculateSensorApertureRaysInput, \"sourcePointNativeSensorMm\" | \"focalLengthMm\" | \"nominalFNumber\" |\n \"angularVelocityRadPerSec\" | \"timeSecondsFromOpeningReference\">, pupil: Pick<IdealCircularPupil, \"radialSampleCount\" | \"angularSampleCount\">,\n focus: ReturnType<typeof parseFocusPlane>): { rays: SensorApertureRay[]; v: number; radius: number } {\n const v = calculateFocusPlaneImageDistance({ focalLengthMm: owned.focalLengthMm, focus }).value.imageDistanceMm;\n // Reuse the existing rotation and time validation, and the check that rays point forward.\n const inverse = calculateInverseCameraRotationImageMapping({ focalLengthMm: owned.focalLengthMm,\n imagePointMm: { x: owned.sourcePointNativeSensorMm.x, y: -owned.sourcePointNativeSensorMm.y },\n angularVelocityRadPerSec: owned.angularVelocityRadPerSec, timeSecondsFromExposureStart: owned.timeSecondsFromOpeningReference,\n ...(focus.kind === \"finite\" ? { focusDistanceM: focus.distanceM } : {}) }).value;\n const displacement = inverse.angularDisplacementRad;\n const radius = owned.focalLengthMm/(2*owned.nominalFNumber), count = pupil.radialSampleCount*pupil.angularSampleCount;\n if (!Number.isFinite(radius) || radius <= 0) throw new InvalidScientificInputError(\"Pupil radius must remain positive and finite.\");\n const rays = Array.from({ length: count }, (_, i): SensorApertureRay => {\n const r = radius*Math.sqrt((Math.floor(i/pupil.angularSampleCount)+.5)/pupil.radialSampleCount);\n const theta = 2*Math.PI*((i%pupil.angularSampleCount)+.5)/pupil.angularSampleCount;\n const point = { x: r*Math.cos(theta), y: r*Math.sin(theta) };\n const origin = { x: point.x/1000, y: point.y/1000, z: 0 };\n const x = owned.sourcePointNativeSensorMm.x/v, y = -owned.sourcePointNativeSensorMm.y/v;\n const direction = focus.kind === \"finite\" ? { x: x*focus.distanceM-origin.x, y: y*focus.distanceM-origin.y, z: focus.distanceM }\n : { x, y, z: 1 };\n const length = Math.hypot(direction.x,direction.y,direction.z);\n const unit = { x: direction.x/length, y: direction.y/length, z: direction.z/length };\n // Same physical right-hand camera rotation as the inverse mapping above.\n const rotatedOrigin = applyPhysicalCameraRotation(origin, displacement, \"camera-to-reference\"),\n rotatedDirection = applyPhysicalCameraRotation(unit, displacement, \"camera-to-reference\");\n if (![...Object.values(rotatedOrigin),...Object.values(rotatedDirection)].every(Number.isFinite) || rotatedDirection.z <= 0) {\n throw new InvalidScientificInputError(\"A pupil ray leaves the supported forward hemisphere or finite coordinate domain.\");\n }\n return { originM: rotatedOrigin, directionUnitVector: rotatedDirection, pupilPointMm: point, weight: 1/count, pupilSampleIndex: i };\n });\n return { rays, v, radius };\n}\n"]}
|
|
@@ -1,18 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* Builds an environment radiance request from points on the physical sensor. It uses the existing
|
|
3
|
+
* focus-aware ideal projection and the analytic inverse camera rotation.
|
|
4
|
+
*
|
|
5
|
+
* Native Y (+Y down) is inverted explicitly. The direction sent to the provider points opposite the
|
|
6
|
+
* look ray at exposure start, because radiance travels toward the camera. This module does not
|
|
7
|
+
* intersect the scene, compute radiance or render anything.
|
|
8
|
+
*
|
|
9
|
+
* Optional lens field mapping (2.0):
|
|
10
|
+
* 1. The physical sensor point is inverse-distorted (radial or Brown-Conrady) to the ideal image
|
|
11
|
+
* point.
|
|
12
|
+
* 2. That point is unprojected with the declared ideal projection (rectilinear, fisheye or
|
|
13
|
+
* equirectangular), at the same focus-aware projection scale.
|
|
14
|
+
* 3. The ray is rotated to the camera axes at exposure start.
|
|
15
|
+
* The local area factor 1 / det(d distorted / d ideal) is reported. The caller applies it to
|
|
16
|
+
* irradiance exactly once. Without the mapping, the existing rectilinear computation is unchanged.
|
|
17
|
+
* @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers
|
|
18
|
+
* and support limits.
|
|
9
19
|
*/
|
|
10
20
|
import { type CalculationResult } from "../core/calculation-result.js";
|
|
11
21
|
import { calculateInverseCameraRotationImageMapping, type CameraAngularVelocityRadPerSec } from "../motion/camera-rotation.js";
|
|
22
|
+
import { type LensProjectionModel } from "../camera/lens-projection.js";
|
|
23
|
+
import { type RadialDistortionProfile, type ValidatedRadialProfile } from "./radial-distortion.js";
|
|
24
|
+
import { type BrownConradyDistortionProfile, type ValidatedBrownConradyDistortionProfile } from "./brown-conrady-distortion.js";
|
|
12
25
|
import { type SceneRadianceEvaluationRequest } from "../schema/scene-radiance.js";
|
|
13
26
|
import { type FocusPlane } from "./focus-state.js";
|
|
27
|
+
/**
|
|
28
|
+
* Lens field mapping between the physical (distorted) sensor point and the scene ray (2.0).
|
|
29
|
+
* `radiometricAreaCorrection` states who applies the distortion area factor. The environment
|
|
30
|
+
* photo signal multiplies irradiance by 1 / det(d distorted / d ideal) exactly once. A supplied
|
|
31
|
+
* field-throughput profile must therefore not include it as well.
|
|
32
|
+
*/
|
|
33
|
+
export interface EnvironmentLensFieldMapping {
|
|
34
|
+
projectionModel: LensProjectionModel;
|
|
35
|
+
distortion: {
|
|
36
|
+
kind: "none";
|
|
37
|
+
} | {
|
|
38
|
+
kind: "radial";
|
|
39
|
+
profile: RadialDistortionProfile;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "brown-conrady";
|
|
42
|
+
profile: BrownConradyDistortionProfile;
|
|
43
|
+
};
|
|
44
|
+
radiometricAreaCorrection: "inverse-distortion-jacobian";
|
|
45
|
+
}
|
|
46
|
+
/** @internal Parsed mapping with validated profiles, reused across one plan's queries. */
|
|
47
|
+
export interface PreparedEnvironmentLensFieldMapping {
|
|
48
|
+
mapping: EnvironmentLensFieldMapping;
|
|
49
|
+
radial?: ValidatedRadialProfile;
|
|
50
|
+
brownConrady?: ValidatedBrownConradyDistortionProfile;
|
|
51
|
+
}
|
|
52
|
+
/** @internal Strict parse and validation of a lens field mapping. Unknown fields are rejected. */
|
|
53
|
+
export declare function prepareEnvironmentLensFieldMapping(value: unknown): PreparedEnvironmentLensFieldMapping;
|
|
14
54
|
export interface CalculateSensorEnvironmentRadianceQueryInput {
|
|
15
|
-
/**
|
|
55
|
+
/** Optical sample point before the anti-aliasing filter or PSF. Native +X right, +Y down, in mm from the optical axis. */
|
|
16
56
|
sourcePointNativeSensorMm: {
|
|
17
57
|
x: number;
|
|
18
58
|
y: number;
|
|
@@ -20,12 +60,27 @@ export interface CalculateSensorEnvironmentRadianceQueryInput {
|
|
|
20
60
|
focalLengthMm: number;
|
|
21
61
|
focus: FocusPlane;
|
|
22
62
|
angularVelocityRadPerSec: CameraAngularVelocityRadPerSec;
|
|
23
|
-
/**
|
|
63
|
+
/** States that the moment the shutter opens is t=0 in the rotation model. */
|
|
24
64
|
timeReference: "first-opening-boundary-phase";
|
|
25
65
|
timeSecondsFromOpeningReference: number;
|
|
26
|
-
/**
|
|
66
|
+
/** The request uses the direction radiance travels: toward the camera, opposite the look ray. */
|
|
27
67
|
environmentDirectionConvention: "outgoing-radiance-toward-camera";
|
|
28
68
|
request: Omit<SceneRadianceEvaluationRequest, "target" | "timeSecondsFromExposureStart">;
|
|
69
|
+
/** Optional 2.0 lens field mapping. Omit it for the ideal rectilinear, distortion-free query. */
|
|
70
|
+
lensFieldMapping?: EnvironmentLensFieldMapping;
|
|
71
|
+
}
|
|
72
|
+
export interface SensorEnvironmentLensFieldMappingResult {
|
|
73
|
+
projectionModel: LensProjectionModel;
|
|
74
|
+
distortionKind: "none" | "radial" | "brown-conrady";
|
|
75
|
+
/** Ideal (undistorted) image-plane point, +X right / +Y up, mm. */
|
|
76
|
+
idealImagePointMm: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
};
|
|
80
|
+
/** Projection scale: thin-lens image distance at finite focus, focal length at infinity, mm. */
|
|
81
|
+
projectionScaleMm: number;
|
|
82
|
+
/** 1 / det(d distorted / d ideal) at this point; 1 without distortion. */
|
|
83
|
+
distortionAreaFactor: number;
|
|
29
84
|
}
|
|
30
85
|
export interface SensorEnvironmentRadianceQuery {
|
|
31
86
|
request: SceneRadianceEvaluationRequest;
|
|
@@ -42,7 +97,10 @@ export interface SensorEnvironmentRadianceQuery {
|
|
|
42
97
|
y: number;
|
|
43
98
|
z: number;
|
|
44
99
|
};
|
|
45
|
-
|
|
100
|
+
/** Rectilinear rotation mapping. Null when a non-rectilinear lens field mapping is used. */
|
|
101
|
+
projection: ReturnType<typeof calculateInverseCameraRotationImageMapping> | null;
|
|
102
|
+
/** Present only when the input declared a lens field mapping. */
|
|
103
|
+
lensFieldMapping?: SensorEnvironmentLensFieldMappingResult;
|
|
46
104
|
targetMeaning: "environment-direction-in-exposure-start-camera-axes";
|
|
47
105
|
directionConvention: "outgoing-radiance-toward-camera";
|
|
48
106
|
geometricRayProjectionCalculated: true;
|
|
@@ -51,10 +109,17 @@ export interface SensorEnvironmentRadianceQuery {
|
|
|
51
109
|
providerExecuted: false;
|
|
52
110
|
}
|
|
53
111
|
/**
|
|
54
|
-
*
|
|
55
|
-
* the existing focus-aware ideal projection and analytic inverse
|
|
56
|
-
*
|
|
57
|
-
*
|
|
112
|
+
* Builds an environment radiance request from points on the physical sensor,
|
|
113
|
+
* using the existing focus-aware ideal projection and the analytic inverse
|
|
114
|
+
* camera rotation.
|
|
115
|
+
*
|
|
116
|
+
* Native Y (+Y down) is inverted explicitly. The provider direction points
|
|
117
|
+
* opposite the look ray at exposure start. Nothing intersects the scene,
|
|
118
|
+
* computes radiance or renders.
|
|
58
119
|
*/
|
|
59
120
|
export declare function calculateSensorEnvironmentRadianceQuery(input: CalculateSensorEnvironmentRadianceQueryInput): CalculationResult<SensorEnvironmentRadianceQuery>;
|
|
60
|
-
|
|
121
|
+
/**
|
|
122
|
+
* @internal Query with a lens field mapping that is already validated. The environment photo-signal
|
|
123
|
+
* planner shares it, so profiles are validated once per plan.
|
|
124
|
+
*/
|
|
125
|
+
export declare function calculateMappedSensorEnvironmentRadianceQuery(input: CalculateSensorEnvironmentRadianceQueryInput, prepared: PreparedEnvironmentLensFieldMapping): CalculationResult<SensorEnvironmentRadianceQuery>;
|
|
@@ -1,25 +1,82 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
3
|
+
* Builds an environment radiance request from points on the physical sensor. It uses the existing
|
|
4
|
+
* focus-aware ideal projection and the analytic inverse camera rotation.
|
|
5
|
+
*
|
|
6
|
+
* Native Y (+Y down) is inverted explicitly. The direction sent to the provider points opposite the
|
|
7
|
+
* look ray at exposure start, because radiance travels toward the camera. This module does not
|
|
8
|
+
* intersect the scene, compute radiance or render anything.
|
|
9
|
+
*
|
|
10
|
+
* Optional lens field mapping (2.0):
|
|
11
|
+
* 1. The physical sensor point is inverse-distorted (radial or Brown-Conrady) to the ideal image
|
|
12
|
+
* point.
|
|
13
|
+
* 2. That point is unprojected with the declared ideal projection (rectilinear, fisheye or
|
|
14
|
+
* equirectangular), at the same focus-aware projection scale.
|
|
15
|
+
* 3. The ray is rotated to the camera axes at exposure start.
|
|
16
|
+
* The local area factor 1 / det(d distorted / d ideal) is reported. The caller applies it to
|
|
17
|
+
* irradiance exactly once. Without the mapping, the existing rectilinear computation is unchanged.
|
|
18
|
+
* @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers
|
|
19
|
+
* and support limits.
|
|
10
20
|
*/
|
|
11
21
|
import { approximationResult } from "../core/calculation-result.js";
|
|
12
22
|
import { InvalidScientificInputError } from "../core/validation.js";
|
|
13
|
-
import { calculateInverseCameraRotationImageMapping } from "../motion/camera-rotation.js";
|
|
23
|
+
import { applyPhysicalCameraRotation, calculateInverseCameraRotationImageMapping } from "../motion/camera-rotation.js";
|
|
24
|
+
import { lensProjectionDirectionValue, parseLensProjectionModel } from "../camera/lens-projection.js";
|
|
25
|
+
import { calculateInverseRadialSourcePointValue, validateRadialDistortionProfile } from "./radial-distortion.js";
|
|
26
|
+
import { brownConradyForwardValue, brownConradyInverseValue, validateBrownConradyDistortionProfile } from "./brown-conrady-distortion.js";
|
|
27
|
+
import { calculateThinLensImageDistance } from "./thin-lens.js";
|
|
14
28
|
import { parseSceneRadianceEvaluationRequest } from "../schema/scene-radiance.js";
|
|
15
29
|
import { parseFocusPlane } from "./focus-state.js";
|
|
30
|
+
import { requireInputKeys } from "../core/record-validation.js";
|
|
31
|
+
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
32
|
+
/** @internal Strict parse and validation of a lens field mapping. Unknown fields are rejected. */
|
|
33
|
+
export function prepareEnvironmentLensFieldMapping(value) {
|
|
34
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
35
|
+
throw new InvalidConfigurationError("lensFieldMapping must be an object.");
|
|
36
|
+
}
|
|
37
|
+
const record = value;
|
|
38
|
+
for (const key of Object.keys(record)) {
|
|
39
|
+
if (!["projectionModel", "distortion", "radiometricAreaCorrection"].includes(key)) {
|
|
40
|
+
throw new InvalidConfigurationError(`lensFieldMapping has unknown field ${JSON.stringify(key)}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (record.radiometricAreaCorrection !== "inverse-distortion-jacobian") {
|
|
44
|
+
throw new InvalidConfigurationError("lensFieldMapping.radiometricAreaCorrection must be \"inverse-distortion-jacobian\".");
|
|
45
|
+
}
|
|
46
|
+
const projectionModel = parseLensProjectionModel(record.projectionModel);
|
|
47
|
+
const distortion = record.distortion;
|
|
48
|
+
if (typeof distortion !== "object" || distortion === null) {
|
|
49
|
+
throw new InvalidConfigurationError("lensFieldMapping.distortion must be an object.");
|
|
50
|
+
}
|
|
51
|
+
if (distortion.kind === "none") {
|
|
52
|
+
return { mapping: { projectionModel, distortion: { kind: "none" }, radiometricAreaCorrection: "inverse-distortion-jacobian" } };
|
|
53
|
+
}
|
|
54
|
+
if (distortion.kind === "radial") {
|
|
55
|
+
const radial = validateRadialDistortionProfile(distortion.profile);
|
|
56
|
+
return { mapping: { projectionModel, distortion: { kind: "radial", profile: distortion.profile },
|
|
57
|
+
radiometricAreaCorrection: "inverse-distortion-jacobian" }, radial };
|
|
58
|
+
}
|
|
59
|
+
if (distortion.kind === "brown-conrady") {
|
|
60
|
+
const brownConrady = validateBrownConradyDistortionProfile(distortion.profile);
|
|
61
|
+
return { mapping: { projectionModel, distortion: { kind: "brown-conrady", profile: distortion.profile },
|
|
62
|
+
radiometricAreaCorrection: "inverse-distortion-jacobian" }, brownConrady };
|
|
63
|
+
}
|
|
64
|
+
throw new InvalidConfigurationError("lensFieldMapping.distortion.kind must be none, radial or brown-conrady.");
|
|
65
|
+
}
|
|
16
66
|
/**
|
|
17
|
-
*
|
|
18
|
-
* the existing focus-aware ideal projection and analytic inverse
|
|
19
|
-
*
|
|
20
|
-
*
|
|
67
|
+
* Builds an environment radiance request from points on the physical sensor,
|
|
68
|
+
* using the existing focus-aware ideal projection and the analytic inverse
|
|
69
|
+
* camera rotation.
|
|
70
|
+
*
|
|
71
|
+
* Native Y (+Y down) is inverted explicitly. The provider direction points
|
|
72
|
+
* opposite the look ray at exposure start. Nothing intersects the scene,
|
|
73
|
+
* computes radiance or renders.
|
|
21
74
|
*/
|
|
22
75
|
export function calculateSensorEnvironmentRadianceQuery(input) {
|
|
76
|
+
requireInputKeys(input, "calculateSensorEnvironmentRadianceQuery", ["sourcePointNativeSensorMm", "focalLengthMm", "focus", "angularVelocityRadPerSec", "timeReference", "timeSecondsFromOpeningReference", "environmentDirectionConvention", "request", "lensFieldMapping"]);
|
|
77
|
+
if (input.lensFieldMapping !== undefined) {
|
|
78
|
+
return calculateMappedSensorEnvironmentRadianceQuery(input, prepareEnvironmentLensFieldMapping(input.lensFieldMapping));
|
|
79
|
+
}
|
|
23
80
|
if (input.timeReference !== "first-opening-boundary-phase" ||
|
|
24
81
|
input.environmentDirectionConvention !== "outgoing-radiance-toward-camera") {
|
|
25
82
|
throw new InvalidScientificInputError("Environment projection requires explicit opening-boundary time and outgoing-toward-camera direction conventions.");
|
|
@@ -47,4 +104,80 @@ export function calculateSensorEnvironmentRadianceQuery(input) {
|
|
|
47
104
|
"Lens distortion, breathing, chromatic field mapping, translation/parallax and scene intersections remain separate."
|
|
48
105
|
]);
|
|
49
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @internal Query with a lens field mapping that is already validated. The environment photo-signal
|
|
109
|
+
* planner shares it, so profiles are validated once per plan.
|
|
110
|
+
*/
|
|
111
|
+
export function calculateMappedSensorEnvironmentRadianceQuery(input, prepared) {
|
|
112
|
+
if (input.timeReference !== "first-opening-boundary-phase" ||
|
|
113
|
+
input.environmentDirectionConvention !== "outgoing-radiance-toward-camera") {
|
|
114
|
+
throw new InvalidScientificInputError("Environment projection requires explicit opening-boundary time and outgoing-toward-camera direction conventions.");
|
|
115
|
+
}
|
|
116
|
+
const focus = parseFocusPlane(input.focus);
|
|
117
|
+
const sourcePointImagePlaneMm = { x: input.sourcePointNativeSensorMm.x, y: -input.sourcePointNativeSensorMm.y };
|
|
118
|
+
const mapping = prepared.mapping;
|
|
119
|
+
let ideal = sourcePointImagePlaneMm;
|
|
120
|
+
let distortionAreaFactor = 1;
|
|
121
|
+
if (prepared.radial !== undefined) {
|
|
122
|
+
ideal = calculateInverseRadialSourcePointValue(sourcePointImagePlaneMm, prepared.radial, "sourcePointNativeSensorMm").sourceImagePointMm;
|
|
123
|
+
// Radial map p -> s(r) p: det = s (s + r ds/dr) with r ds/dr = 2 r^2 s'(r^2).
|
|
124
|
+
const { k1, k2, k3 } = prepared.radial.coefficients;
|
|
125
|
+
const r2 = (ideal.x * ideal.x + ideal.y * ideal.y) / prepared.radial.normalizationRadiusMm ** 2;
|
|
126
|
+
const scale = 1 + k1 * r2 + k2 * r2 * r2 + k3 * r2 * r2 * r2;
|
|
127
|
+
const radialDerivative = 1 + 3 * k1 * r2 + 5 * k2 * r2 * r2 + 7 * k3 * r2 * r2 * r2;
|
|
128
|
+
distortionAreaFactor = 1 / (scale * radialDerivative);
|
|
129
|
+
}
|
|
130
|
+
else if (prepared.brownConrady !== undefined) {
|
|
131
|
+
ideal = brownConradyInverseValue(prepared.brownConrady, sourcePointImagePlaneMm);
|
|
132
|
+
const j = brownConradyForwardValue(prepared.brownConrady, ideal).jacobian;
|
|
133
|
+
distortionAreaFactor = 1 / (j[0] * j[3] - j[1] * j[2]);
|
|
134
|
+
}
|
|
135
|
+
if (!(distortionAreaFactor > 0) || !Number.isFinite(distortionAreaFactor)) {
|
|
136
|
+
throw new InvalidScientificInputError("Distortion area factor must remain finite and positive.");
|
|
137
|
+
}
|
|
138
|
+
let projection = null;
|
|
139
|
+
let look;
|
|
140
|
+
let projectionScaleMm;
|
|
141
|
+
if (mapping.projectionModel === "rectilinear") {
|
|
142
|
+
projection = calculateInverseCameraRotationImageMapping({ focalLengthMm: input.focalLengthMm,
|
|
143
|
+
imagePointMm: ideal, angularVelocityRadPerSec: input.angularVelocityRadPerSec,
|
|
144
|
+
timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,
|
|
145
|
+
...(focus.kind === "finite" ? { focusDistanceM: focus.distanceM } : {}) });
|
|
146
|
+
const point = projection.value.referenceImagePointMm, z = projection.value.projectionDistanceMm;
|
|
147
|
+
const length = Math.hypot(point.x, point.y, z);
|
|
148
|
+
look = { x: point.x / length, y: point.y / length, z: z / length };
|
|
149
|
+
projectionScaleMm = z;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
projectionScaleMm = focus.kind === "finite"
|
|
153
|
+
? calculateThinLensImageDistance({ focalLengthMm: input.focalLengthMm, objectDistanceM: focus.distanceM }).value.imageDistanceMm
|
|
154
|
+
: input.focalLengthMm;
|
|
155
|
+
const velocity = input.angularVelocityRadPerSec;
|
|
156
|
+
const t = input.timeSecondsFromOpeningReference;
|
|
157
|
+
if (typeof t !== "number" || !Number.isFinite(t) || t < 0) {
|
|
158
|
+
throw new InvalidScientificInputError("timeSecondsFromOpeningReference must be finite and non-negative.");
|
|
159
|
+
}
|
|
160
|
+
const captured = lensProjectionDirectionValue(mapping.projectionModel, projectionScaleMm, ideal.x, ideal.y);
|
|
161
|
+
const reference = applyPhysicalCameraRotation(captured, { pitch: velocity.pitch * t, yaw: velocity.yaw * t, roll: velocity.roll * t }, "camera-to-reference");
|
|
162
|
+
const length = Math.hypot(reference.x, reference.y, reference.z);
|
|
163
|
+
if (!(length > 0) || !Number.isFinite(length))
|
|
164
|
+
throw new InvalidScientificInputError("Mapped reference ray must be finite.");
|
|
165
|
+
look = { x: reference.x / length, y: reference.y / length, z: reference.z / length };
|
|
166
|
+
}
|
|
167
|
+
const request = parseSceneRadianceEvaluationRequest({ ...input.request,
|
|
168
|
+
timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,
|
|
169
|
+
target: { kind: "environment-direction", outgoingDirectionUnitVector: { x: -look.x, y: -look.y, z: -look.z } } });
|
|
170
|
+
return approximationResult({ request, sourcePointNativeSensorMm: { ...input.sourcePointNativeSensorMm },
|
|
171
|
+
sourcePointImagePlaneMm, referenceLookDirectionUnitVector: look, projection,
|
|
172
|
+
lensFieldMapping: { projectionModel: mapping.projectionModel, distortionKind: mapping.distortion.kind,
|
|
173
|
+
idealImagePointMm: { ...ideal }, projectionScaleMm, distortionAreaFactor },
|
|
174
|
+
targetMeaning: "environment-direction-in-exposure-start-camera-axes", directionConvention: "outgoing-radiance-toward-camera",
|
|
175
|
+
geometricRayProjectionCalculated: true, sceneIntersectionCalculated: false, visibilityCalculated: false, providerExecuted: false
|
|
176
|
+
}, "lens-mapped-sensor-environment-radiance-query", "0.1.0", [
|
|
177
|
+
"The physical sensor point is inverse-distorted to the ideal image point, then unprojected with the declared ideal projection and rotated by the constant-axis pure camera rotation.",
|
|
178
|
+
"Projection scale is the thin-lens image distance at finite focus (focal length at infinity) for every projection model; a calibrated finite-focus fisheye scale is not modeled.",
|
|
179
|
+
"The distortion area factor 1/det(d distorted/d ideal) is reported for exactly-once application to irradiance; field throughput, PSF and pupil models are not changed by this query.",
|
|
180
|
+
"Breathing, chromatic field mapping, translation/parallax and scene intersections remain separate."
|
|
181
|
+
]);
|
|
182
|
+
}
|
|
50
183
|
//# sourceMappingURL=sensor-environment-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensor-environment-query.js","sourceRoot":"","sources":["../../src/optics/sensor-environment-query.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;GAQG;AAEH,OAAO,EAAE,mBAAmB,EAA0B,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,0CAA0C,EACZ,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,mCAAmC,EAAuC,MAA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-2.0\n\n/**\n * Builds an environment radiance request from points on the physical sensor. It uses the existing\n * focus-aware ideal projection and the analytic inverse camera rotation.\n *\n * Native Y (+Y down) is inverted explicitly. The direction sent to the provider points opposite the\n * look ray at exposure start, because radiance travels toward the camera. This module does not\n * intersect the scene, compute radiance or render anything.\n *\n * Optional lens field mapping (2.0):\n * 1. The physical sensor point is inverse-distorted (radial or Brown-Conrady) to the ideal image\n * point.\n * 2. That point is unprojected with the declared ideal projection (rectilinear, fisheye or\n * equirectangular), at the same focus-aware projection scale.\n * 3. The ray is rotated to the camera axes at exposure start.\n * The local area factor 1 / det(d distorted / d ideal) is reported. The caller applies it to\n * irradiance exactly once. Without the mapping, the existing rectilinear computation is unchanged.\n * @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers\n * and support limits.\n */\n\nimport { approximationResult, type CalculationResult } from \"../core/calculation-result.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport { applyPhysicalCameraRotation, calculateInverseCameraRotationImageMapping,\n type CameraAngularVelocityRadPerSec } from \"../motion/camera-rotation.js\";\nimport { lensProjectionDirectionValue, parseLensProjectionModel, type LensProjectionModel } from \"../camera/lens-projection.js\";\nimport {\n calculateInverseRadialSourcePointValue, validateRadialDistortionProfile, type RadialDistortionProfile, type ValidatedRadialProfile\n} from \"./radial-distortion.js\";\nimport {\n brownConradyForwardValue, brownConradyInverseValue, validateBrownConradyDistortionProfile,\n type BrownConradyDistortionProfile, type ValidatedBrownConradyDistortionProfile\n} from \"./brown-conrady-distortion.js\";\nimport { calculateThinLensImageDistance } from \"./thin-lens.js\";\nimport { parseSceneRadianceEvaluationRequest, type SceneRadianceEvaluationRequest } from \"../schema/scene-radiance.js\";\nimport { parseFocusPlane, type FocusPlane } from \"./focus-state.js\";\nimport { requireInputKeys } from \"../core/record-validation.js\";\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\n\n/**\n * Lens field mapping between the physical (distorted) sensor point and the scene ray (2.0).\n * `radiometricAreaCorrection` states who applies the distortion area factor. The environment\n * photo signal multiplies irradiance by 1 / det(d distorted / d ideal) exactly once. A supplied\n * field-throughput profile must therefore not include it as well.\n */\nexport interface EnvironmentLensFieldMapping {\n projectionModel: LensProjectionModel;\n distortion:\n | { kind: \"none\" }\n | { kind: \"radial\"; profile: RadialDistortionProfile }\n | { kind: \"brown-conrady\"; profile: BrownConradyDistortionProfile };\n radiometricAreaCorrection: \"inverse-distortion-jacobian\";\n}\n\n/** @internal Parsed mapping with validated profiles, reused across one plan's queries. */\nexport interface PreparedEnvironmentLensFieldMapping {\n mapping: EnvironmentLensFieldMapping;\n radial?: ValidatedRadialProfile;\n brownConrady?: ValidatedBrownConradyDistortionProfile;\n}\n\n/** @internal Strict parse and validation of a lens field mapping. Unknown fields are rejected. */\nexport function prepareEnvironmentLensFieldMapping(value: unknown): PreparedEnvironmentLensFieldMapping {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new InvalidConfigurationError(\"lensFieldMapping must be an object.\");\n }\n const record = value as Record<string, unknown>;\n for (const key of Object.keys(record)) {\n if (![\"projectionModel\", \"distortion\", \"radiometricAreaCorrection\"].includes(key)) {\n throw new InvalidConfigurationError(`lensFieldMapping has unknown field ${JSON.stringify(key)}.`);\n }\n }\n if (record.radiometricAreaCorrection !== \"inverse-distortion-jacobian\") {\n throw new InvalidConfigurationError(\"lensFieldMapping.radiometricAreaCorrection must be \\\"inverse-distortion-jacobian\\\".\");\n }\n const projectionModel = parseLensProjectionModel(record.projectionModel);\n const distortion = record.distortion as EnvironmentLensFieldMapping[\"distortion\"] | undefined;\n if (typeof distortion !== \"object\" || distortion === null) {\n throw new InvalidConfigurationError(\"lensFieldMapping.distortion must be an object.\");\n }\n if (distortion.kind === \"none\") {\n return { mapping: { projectionModel, distortion: { kind: \"none\" }, radiometricAreaCorrection: \"inverse-distortion-jacobian\" } };\n }\n if (distortion.kind === \"radial\") {\n const radial = validateRadialDistortionProfile(distortion.profile);\n return { mapping: { projectionModel, distortion: { kind: \"radial\", profile: distortion.profile },\n radiometricAreaCorrection: \"inverse-distortion-jacobian\" }, radial };\n }\n if (distortion.kind === \"brown-conrady\") {\n const brownConrady = validateBrownConradyDistortionProfile(distortion.profile);\n return { mapping: { projectionModel, distortion: { kind: \"brown-conrady\", profile: distortion.profile },\n radiometricAreaCorrection: \"inverse-distortion-jacobian\" }, brownConrady };\n }\n throw new InvalidConfigurationError(\"lensFieldMapping.distortion.kind must be none, radial or brown-conrady.\");\n}\n\nexport interface CalculateSensorEnvironmentRadianceQueryInput {\n /** Optical sample point before the anti-aliasing filter or PSF. Native +X right, +Y down, in mm from the optical axis. */\n sourcePointNativeSensorMm: { x: number; y: number };\n focalLengthMm: number;\n focus: FocusPlane;\n angularVelocityRadPerSec: CameraAngularVelocityRadPerSec;\n /** States that the moment the shutter opens is t=0 in the rotation model. */\n timeReference: \"first-opening-boundary-phase\";\n timeSecondsFromOpeningReference: number;\n /** The request uses the direction radiance travels: toward the camera, opposite the look ray. */\n environmentDirectionConvention: \"outgoing-radiance-toward-camera\";\n request: Omit<SceneRadianceEvaluationRequest, \"target\" | \"timeSecondsFromExposureStart\">;\n /** Optional 2.0 lens field mapping. Omit it for the ideal rectilinear, distortion-free query. */\n lensFieldMapping?: EnvironmentLensFieldMapping;\n}\n\nexport interface SensorEnvironmentLensFieldMappingResult {\n projectionModel: LensProjectionModel;\n distortionKind: \"none\" | \"radial\" | \"brown-conrady\";\n /** Ideal (undistorted) image-plane point, +X right / +Y up, mm. */\n idealImagePointMm: { x: number; y: number };\n /** Projection scale: thin-lens image distance at finite focus, focal length at infinity, mm. */\n projectionScaleMm: number;\n /** 1 / det(d distorted / d ideal) at this point; 1 without distortion. */\n distortionAreaFactor: number;\n}\n\nexport interface SensorEnvironmentRadianceQuery {\n request: SceneRadianceEvaluationRequest;\n sourcePointNativeSensorMm: { x: number; y: number };\n sourcePointImagePlaneMm: { x: number; y: number };\n referenceLookDirectionUnitVector: { x: number; y: number; z: number };\n /** Rectilinear rotation mapping. Null when a non-rectilinear lens field mapping is used. */\n projection: ReturnType<typeof calculateInverseCameraRotationImageMapping> | null;\n /** Present only when the input declared a lens field mapping. */\n lensFieldMapping?: SensorEnvironmentLensFieldMappingResult;\n targetMeaning: \"environment-direction-in-exposure-start-camera-axes\";\n directionConvention: \"outgoing-radiance-toward-camera\";\n geometricRayProjectionCalculated: true;\n sceneIntersectionCalculated: false;\n visibilityCalculated: false;\n providerExecuted: false;\n}\n\n/**\n * Builds an environment radiance request from points on the physical sensor,\n * using the existing focus-aware ideal projection and the analytic inverse\n * camera rotation.\n *\n * Native Y (+Y down) is inverted explicitly. The provider direction points\n * opposite the look ray at exposure start. Nothing intersects the scene,\n * computes radiance or renders.\n */\nexport function calculateSensorEnvironmentRadianceQuery(\n input: CalculateSensorEnvironmentRadianceQueryInput\n): CalculationResult<SensorEnvironmentRadianceQuery> {\n requireInputKeys(input, \"calculateSensorEnvironmentRadianceQuery\", [\"sourcePointNativeSensorMm\", \"focalLengthMm\", \"focus\", \"angularVelocityRadPerSec\", \"timeReference\", \"timeSecondsFromOpeningReference\", \"environmentDirectionConvention\", \"request\", \"lensFieldMapping\"]);\n if (input.lensFieldMapping !== undefined) {\n return calculateMappedSensorEnvironmentRadianceQuery(input, prepareEnvironmentLensFieldMapping(input.lensFieldMapping));\n }\n if (input.timeReference !== \"first-opening-boundary-phase\" ||\n input.environmentDirectionConvention !== \"outgoing-radiance-toward-camera\") {\n throw new InvalidScientificInputError(\"Environment projection requires explicit opening-boundary time and outgoing-toward-camera direction conventions.\");\n }\n const focus = parseFocusPlane(input.focus);\n const sourcePointImagePlaneMm = { x: input.sourcePointNativeSensorMm.x, y: -input.sourcePointNativeSensorMm.y };\n const projection = calculateInverseCameraRotationImageMapping({ focalLengthMm: input.focalLengthMm,\n imagePointMm: sourcePointImagePlaneMm, angularVelocityRadPerSec: input.angularVelocityRadPerSec,\n timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,\n ...(focus.kind === \"finite\" ? { focusDistanceM: focus.distanceM } : {}) });\n const point = projection.value.referenceImagePointMm, z = projection.value.projectionDistanceMm;\n const length = Math.hypot(point.x, point.y, z);\n const referenceLookDirectionUnitVector = { x: point.x/length, y: point.y/length, z: z/length };\n const ray = referenceLookDirectionUnitVector;\n const request = parseSceneRadianceEvaluationRequest({ ...input.request,\n timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,\n target: { kind: \"environment-direction\", outgoingDirectionUnitVector: { x: -ray.x, y: -ray.y, z: -ray.z } } });\n return approximationResult({ request, sourcePointNativeSensorMm: { ...input.sourcePointNativeSensorMm },\n sourcePointImagePlaneMm, referenceLookDirectionUnitVector, projection,\n targetMeaning: \"environment-direction-in-exposure-start-camera-axes\", directionConvention: \"outgoing-radiance-toward-camera\",\n geometricRayProjectionCalculated: true, sceneIntersectionCalculated: false, visibilityCalculated: false, providerExecuted: false\n }, \"sensor-environment-radiance-query\", \"0.1.0\", [\n \"Ideal focus-aware rectilinear projection and constant-axis pure camera rotation; reference ray must stay in the forward hemisphere.\",\n \"The environment and rotation reference axes coincide with camera axes at the first opening boundary by explicit convention.\",\n \"Lens distortion, breathing, chromatic field mapping, translation/parallax and scene intersections remain separate.\"\n ]);\n}\n\n/**\n * @internal Query with a lens field mapping that is already validated. The environment photo-signal\n * planner shares it, so profiles are validated once per plan.\n */\nexport function calculateMappedSensorEnvironmentRadianceQuery(\n input: CalculateSensorEnvironmentRadianceQueryInput,\n prepared: PreparedEnvironmentLensFieldMapping\n): CalculationResult<SensorEnvironmentRadianceQuery> {\n if (input.timeReference !== \"first-opening-boundary-phase\" ||\n input.environmentDirectionConvention !== \"outgoing-radiance-toward-camera\") {\n throw new InvalidScientificInputError(\"Environment projection requires explicit opening-boundary time and outgoing-toward-camera direction conventions.\");\n }\n const focus = parseFocusPlane(input.focus);\n const sourcePointImagePlaneMm = { x: input.sourcePointNativeSensorMm.x, y: -input.sourcePointNativeSensorMm.y };\n const mapping = prepared.mapping;\n let ideal = sourcePointImagePlaneMm;\n let distortionAreaFactor = 1;\n if (prepared.radial !== undefined) {\n ideal = calculateInverseRadialSourcePointValue(sourcePointImagePlaneMm, prepared.radial, \"sourcePointNativeSensorMm\").sourceImagePointMm;\n // Radial map p -> s(r) p: det = s (s + r ds/dr) with r ds/dr = 2 r^2 s'(r^2).\n const { k1, k2, k3 } = prepared.radial.coefficients;\n const r2 = (ideal.x*ideal.x+ideal.y*ideal.y)/prepared.radial.normalizationRadiusMm**2;\n const scale = 1+k1*r2+k2*r2*r2+k3*r2*r2*r2;\n const radialDerivative = 1+3*k1*r2+5*k2*r2*r2+7*k3*r2*r2*r2;\n distortionAreaFactor = 1/(scale*radialDerivative);\n } else if (prepared.brownConrady !== undefined) {\n ideal = brownConradyInverseValue(prepared.brownConrady, sourcePointImagePlaneMm);\n const j = brownConradyForwardValue(prepared.brownConrady, ideal).jacobian;\n distortionAreaFactor = 1/(j[0]*j[3]-j[1]*j[2]);\n }\n if (!(distortionAreaFactor > 0) || !Number.isFinite(distortionAreaFactor)) {\n throw new InvalidScientificInputError(\"Distortion area factor must remain finite and positive.\");\n }\n let projection: ReturnType<typeof calculateInverseCameraRotationImageMapping> | null = null;\n let look: { x: number; y: number; z: number };\n let projectionScaleMm: number;\n if (mapping.projectionModel === \"rectilinear\") {\n projection = calculateInverseCameraRotationImageMapping({ focalLengthMm: input.focalLengthMm,\n imagePointMm: ideal, angularVelocityRadPerSec: input.angularVelocityRadPerSec,\n timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,\n ...(focus.kind === \"finite\" ? { focusDistanceM: focus.distanceM } : {}) });\n const point = projection.value.referenceImagePointMm, z = projection.value.projectionDistanceMm;\n const length = Math.hypot(point.x, point.y, z);\n look = { x: point.x/length, y: point.y/length, z: z/length };\n projectionScaleMm = z;\n } else {\n projectionScaleMm = focus.kind === \"finite\"\n ? calculateThinLensImageDistance({ focalLengthMm: input.focalLengthMm, objectDistanceM: focus.distanceM }).value.imageDistanceMm\n : input.focalLengthMm;\n const velocity = input.angularVelocityRadPerSec;\n const t = input.timeSecondsFromOpeningReference;\n if (typeof t !== \"number\" || !Number.isFinite(t) || t < 0) {\n throw new InvalidScientificInputError(\"timeSecondsFromOpeningReference must be finite and non-negative.\");\n }\n const captured = lensProjectionDirectionValue(mapping.projectionModel, projectionScaleMm, ideal.x, ideal.y);\n const reference = applyPhysicalCameraRotation(captured,\n { pitch: velocity.pitch*t, yaw: velocity.yaw*t, roll: velocity.roll*t }, \"camera-to-reference\");\n const length = Math.hypot(reference.x, reference.y, reference.z);\n if (!(length > 0) || !Number.isFinite(length)) throw new InvalidScientificInputError(\"Mapped reference ray must be finite.\");\n look = { x: reference.x/length, y: reference.y/length, z: reference.z/length };\n }\n const request = parseSceneRadianceEvaluationRequest({ ...input.request,\n timeSecondsFromExposureStart: input.timeSecondsFromOpeningReference,\n target: { kind: \"environment-direction\", outgoingDirectionUnitVector: { x: -look.x, y: -look.y, z: -look.z } } });\n return approximationResult({ request, sourcePointNativeSensorMm: { ...input.sourcePointNativeSensorMm },\n sourcePointImagePlaneMm, referenceLookDirectionUnitVector: look, projection,\n lensFieldMapping: { projectionModel: mapping.projectionModel, distortionKind: mapping.distortion.kind,\n idealImagePointMm: { ...ideal }, projectionScaleMm, distortionAreaFactor },\n targetMeaning: \"environment-direction-in-exposure-start-camera-axes\", directionConvention: \"outgoing-radiance-toward-camera\",\n geometricRayProjectionCalculated: true, sceneIntersectionCalculated: false, visibilityCalculated: false, providerExecuted: false\n }, \"lens-mapped-sensor-environment-radiance-query\", \"0.1.0\", [\n \"The physical sensor point is inverse-distorted to the ideal image point, then unprojected with the declared ideal projection and rotated by the constant-axis pure camera rotation.\",\n \"Projection scale is the thin-lens image distance at finite focus (focal length at infinity) for every projection model; a calibrated finite-focus fisheye scale is not modeled.\",\n \"The distortion area factor 1/det(d distorted/d ideal) is reported for exactly-once application to irradiance; field throughput, PSF and pupil models are not changed by this query.\",\n \"Breathing, chromatic field mapping, translation/parallax and scene intersections remain separate.\"\n ]);\n}\n"]}
|