@photivra/engine 1.5.0 → 2.1.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 +414 -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 +116 -9
- package/dist/capture/native-raw-development.js +221 -62
- 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 +65 -12
- package/dist/capture/native-raw.js +81 -19
- 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/diffraction-provider.d.ts +30 -0
- package/dist/facade/diffraction-provider.js +127 -0
- package/dist/facade/diffraction-provider.js.map +1 -0
- package/dist/facade/host-yield.d.ts +7 -0
- package/dist/facade/host-yield.js +19 -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 +363 -0
- package/dist/facade/simulate-capture.js +1281 -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 +91 -25
- package/dist/index.js +60 -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-psf-profile.d.ts +118 -0
- package/dist/optics/diffraction-psf-profile.js +252 -0
- package/dist/optics/diffraction-psf-profile.js.map +1 -0
- 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 +777 -2
- package/docs/QUICK_START.md +663 -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 -8
- package/docs/api/capture-native-raw-dng.md +84 -0
- package/docs/api/capture-native-raw.md +21 -10
- 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 +2253 -3
- 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 +397 -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-psf-profile.md +96 -0
- 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 -11
- 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/DENSE_PUPIL_QUALIFICATION.md +0 -121
- 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 -54
- 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_1_5_0.md +0 -105
- 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/SEPARABLE_EMISSION_DRAFT.md +0 -103
- 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/dense-pupil-2026-10-06/pilot.jsonl +0 -6
- 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,37 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Geometric image transforms (warps) such as distortion correction and projection changes, and
|
|
3
|
+
* a resampler that applies them.
|
|
4
|
+
*
|
|
5
|
+
* A mapping goes from destination (output) points to source (captured) points. Preparing a
|
|
6
|
+
* mapping fixes it for one still or frame; a change in time needs a new preparation.
|
|
7
|
+
*
|
|
8
|
+
* Transform kinds:
|
|
9
|
+
* - `affine` and `radial` (schema 0.1.0, unchanged).
|
|
10
|
+
* - From mapping schema 0.2.0: `brown-conrady` (radial plus tangential lens distortion) and
|
|
11
|
+
* `projection-remap` (a change of ideal projection, for example fisheye capture to a
|
|
12
|
+
* rectilinear or equirectangular view).
|
|
13
|
+
*
|
|
14
|
+
* A mapping that uses only 0.1.0 kinds keeps schema and model version 0.1.0 and gives identical output.
|
|
5
15
|
* @see docs/DIGITAL_OPTICS_FOUNDATION.md for equations, coordinate/unit conventions, blockers and
|
|
6
16
|
* support limits.
|
|
7
17
|
*/
|
|
8
18
|
import { type CalculationResult } from "../core/calculation-result.js";
|
|
9
19
|
import { type RadialDistortionProfile, type LensFieldPointMm } from "../optics/radial-distortion.js";
|
|
10
|
-
|
|
20
|
+
import { type BrownConradyDistortionProfile } from "../optics/brown-conrady-distortion.js";
|
|
21
|
+
import { type LensProjectionModel } from "../camera/lens-projection.js";
|
|
22
|
+
/** A domain change separates maps: only adjacent maps in the same domain share one resampling pass. */
|
|
11
23
|
export type GeometricImageDomain = "raw-channel" | "reconstructed-linear" | "processed-output";
|
|
12
|
-
/**
|
|
24
|
+
/** Jacobian (derivative) d(source mm)/d(destination mm), in row-major order. */
|
|
13
25
|
export type GeometricJacobian = readonly [number, number, number, number];
|
|
14
26
|
interface TransformIdentity {
|
|
15
27
|
id: string;
|
|
16
28
|
version: string;
|
|
17
29
|
domain: GeometricImageDomain;
|
|
18
|
-
purpose: "distortion" | "breathing" | "digital-stabilization" | "orientation-crop" | "lateral-ca";
|
|
30
|
+
purpose: "distortion" | "breathing" | "digital-stabilization" | "orientation-crop" | "lateral-ca" | "projection";
|
|
19
31
|
}
|
|
20
|
-
/** Explicit destination-to-source affine map,
|
|
32
|
+
/** Explicit destination-to-source affine map, which can include rotation, shear and offset. */
|
|
21
33
|
export interface AffineGeometricTransform extends TransformIdentity {
|
|
22
34
|
kind: "affine";
|
|
23
35
|
matrix: GeometricJacobian;
|
|
24
36
|
offsetMm: LensFieldPointMm;
|
|
25
37
|
}
|
|
26
|
-
/**
|
|
38
|
+
/** Radial distortion. A correction reads the physically distorted data at the position mapped from each ideal (undistorted) destination point. */
|
|
27
39
|
export interface RadialGeometricTransform extends TransformIdentity {
|
|
28
40
|
kind: "radial";
|
|
29
41
|
profile: RadialDistortionProfile;
|
|
30
42
|
}
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
/** Schema 0.2.0: Brown-Conrady distortion. A correction reads the distorted data at the position mapped from each ideal destination point. */
|
|
44
|
+
export interface BrownConradyGeometricTransform extends TransformIdentity {
|
|
45
|
+
kind: "brown-conrady";
|
|
46
|
+
profile: BrownConradyDistortionProfile;
|
|
47
|
+
}
|
|
48
|
+
/** One ideal projection and its mapping scale (focal length, or mm per radian for equirectangular). */
|
|
49
|
+
export interface GeometricProjectionDeclaration {
|
|
50
|
+
projectionModel: LensProjectionModel;
|
|
51
|
+
focalLengthMm: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Schema 0.2.0: change of projection. Each destination point becomes a scene direction (using
|
|
55
|
+
* the destination projection), then a source point (using the source projection). Purpose must
|
|
56
|
+
* be "projection".
|
|
57
|
+
*/
|
|
58
|
+
export interface ProjectionRemapGeometricTransform extends TransformIdentity {
|
|
59
|
+
kind: "projection-remap";
|
|
60
|
+
destinationProjection: GeometricProjectionDeclaration;
|
|
61
|
+
sourceProjection: GeometricProjectionDeclaration;
|
|
62
|
+
}
|
|
63
|
+
export type DigitalGeometricTransform = AffineGeometricTransform | RadialGeometricTransform | BrownConradyGeometricTransform | ProjectionRemapGeometricTransform;
|
|
64
|
+
/** Serializable prepared mapping. Maps are applied in the listed order, from destination towards source. */
|
|
33
65
|
export interface PreparedGeometricMapping {
|
|
34
|
-
|
|
66
|
+
/** 0.1.0 when only affine and radial kinds are used; 0.2.0 when a kind added in 2.0 is present. */
|
|
67
|
+
schemaVersion: "0.1.0" | "0.2.0";
|
|
35
68
|
frameTimeSeconds: number;
|
|
36
69
|
transforms: readonly DigitalGeometricTransform[];
|
|
37
70
|
semanticKey: string;
|
|
@@ -40,14 +73,14 @@ export interface PreparedGeometricMapping {
|
|
|
40
73
|
componentIds: readonly string[];
|
|
41
74
|
}[];
|
|
42
75
|
}
|
|
43
|
-
/**
|
|
76
|
+
/** A regular grid of pixel centres on the optical plane: +X right, +Y up; rows run top to bottom. */
|
|
44
77
|
export interface GeometricRaster {
|
|
45
78
|
width: number;
|
|
46
79
|
height: number;
|
|
47
80
|
centerMm: LensFieldPointMm;
|
|
48
81
|
pitchMm: number;
|
|
49
82
|
}
|
|
50
|
-
/**
|
|
83
|
+
/** The resampling filter, chosen independently of the mapping. Any prefiltering (anti-aliasing) is the caller's job. */
|
|
51
84
|
export interface GeometricResampler {
|
|
52
85
|
id: string;
|
|
53
86
|
version: string;
|
|
@@ -72,9 +105,9 @@ export interface GeometricSamplingPlan {
|
|
|
72
105
|
destinationRaster: GeometricRaster;
|
|
73
106
|
resampler: GeometricResampler;
|
|
74
107
|
points: readonly GeometricMappingPoint[];
|
|
75
|
-
/**
|
|
108
|
+
/** True where the selected filter has full source support around the pixel centre. Edges are not extended. */
|
|
76
109
|
validSourceMask: readonly boolean[];
|
|
77
|
-
/** Largest
|
|
110
|
+
/** Largest axis-aligned rectangle of valid pixels (half-open). Null if there is none. */
|
|
78
111
|
jointCrop: {
|
|
79
112
|
x: number;
|
|
80
113
|
y: number;
|
|
@@ -87,7 +120,7 @@ export interface GeometricSamplingPlan {
|
|
|
87
120
|
horizontal: number;
|
|
88
121
|
vertical: number;
|
|
89
122
|
};
|
|
90
|
-
/**
|
|
123
|
+
/** Angular extent of the mapped pixel-centre rays kept by the joint crop. It is not the edge-to-edge FOV. */
|
|
91
124
|
retainedSampleRayEnvelopeDegrees: {
|
|
92
125
|
minX: number;
|
|
93
126
|
maxX: number;
|
|
@@ -95,19 +128,19 @@ export interface GeometricSamplingPlan {
|
|
|
95
128
|
maxY: number;
|
|
96
129
|
} | null;
|
|
97
130
|
}
|
|
98
|
-
/**
|
|
131
|
+
/** Strictly parses transform data. Unknown kinds or fields and profiles that cannot be inverted are rejected. */
|
|
99
132
|
export declare function parseDigitalGeometricTransform(value: unknown): DigitalGeometricTransform;
|
|
100
|
-
/** Prepares deterministic still
|
|
133
|
+
/** Prepares a deterministic mapping for one still or frame. A change in time needs a new preparation. */
|
|
101
134
|
export declare function prepareGeometricMapping(input: {
|
|
102
135
|
transforms: readonly DigitalGeometricTransform[];
|
|
103
136
|
frameTimeSeconds: number;
|
|
104
137
|
}): CalculationResult<PreparedGeometricMapping>;
|
|
105
|
-
/**
|
|
138
|
+
/** Maps a display point to the capture, with the full local derivatives in each direction. */
|
|
106
139
|
export declare function calculateComposedGeometricMapping(input: {
|
|
107
140
|
mapping: PreparedGeometricMapping;
|
|
108
141
|
destinationPointMm: LensFieldPointMm;
|
|
109
142
|
}): CalculationResult<GeometricMappingPoint>;
|
|
110
|
-
/**
|
|
143
|
+
/** Maps a capture point to the display, for focus, metering and overlays. It inverts the same maps. */
|
|
111
144
|
export declare function calculateForwardGeometricMapping(input: {
|
|
112
145
|
mapping: PreparedGeometricMapping;
|
|
113
146
|
sourcePointMm: LensFieldPointMm;
|
|
@@ -116,15 +149,20 @@ export declare function calculateForwardGeometricMapping(input: {
|
|
|
116
149
|
export declare function parseGeometricRaster(value: unknown): GeometricRaster;
|
|
117
150
|
/** @internal Shared deterministic crop for a validated pixel mask. */
|
|
118
151
|
export declare function calculateValidSourceCrop(mask: readonly boolean[], width: number, height: number): GeometricSamplingPlan["jointCrop"];
|
|
119
|
-
/**
|
|
152
|
+
/** Composes compatible inverse maps, then resolves one shared plan for validity, crop and anti-aliasing (AA). */
|
|
120
153
|
export declare function calculateGeometricSamplingPlan(input: {
|
|
121
154
|
mapping: PreparedGeometricMapping;
|
|
122
155
|
sourceRaster: GeometricRaster;
|
|
123
156
|
destinationRaster: GeometricRaster;
|
|
124
157
|
resampler: GeometricResampler;
|
|
125
158
|
physicalProjectionDistanceMm: number;
|
|
159
|
+
/**
|
|
160
|
+
* Ideal projection of the captured (source) image, used for the reported angles. Omitted or
|
|
161
|
+
* "rectilinear" keeps the existing atan(mm / projection distance) angles exactly.
|
|
162
|
+
*/
|
|
163
|
+
sourceProjectionModel?: LensProjectionModel;
|
|
126
164
|
}): CalculationResult<GeometricSamplingPlan>;
|
|
127
|
-
/**
|
|
165
|
+
/** Resamples an already-formed single-channel image once. A null output sample marks missing source data. */
|
|
128
166
|
export declare function calculateGeometricResampling(input: {
|
|
129
167
|
plan: GeometricSamplingPlan;
|
|
130
168
|
sourceSamples: readonly number[];
|
|
@@ -134,4 +172,3 @@ export declare function calculateGeometricResampling(input: {
|
|
|
134
172
|
resampler: GeometricResampler;
|
|
135
173
|
}>;
|
|
136
174
|
export {};
|
|
137
|
-
//# sourceMappingURL=geometric-transforms.d.ts.map
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Geometric image transforms (warps) such as distortion correction and projection changes, and
|
|
4
|
+
* a resampler that applies them.
|
|
5
|
+
*
|
|
6
|
+
* A mapping goes from destination (output) points to source (captured) points. Preparing a
|
|
7
|
+
* mapping fixes it for one still or frame; a change in time needs a new preparation.
|
|
8
|
+
*
|
|
9
|
+
* Transform kinds:
|
|
10
|
+
* - `affine` and `radial` (schema 0.1.0, unchanged).
|
|
11
|
+
* - From mapping schema 0.2.0: `brown-conrady` (radial plus tangential lens distortion) and
|
|
12
|
+
* `projection-remap` (a change of ideal projection, for example fisheye capture to a
|
|
13
|
+
* rectilinear or equirectangular view).
|
|
14
|
+
*
|
|
15
|
+
* A mapping that uses only 0.1.0 kinds keeps schema and model version 0.1.0 and gives identical output.
|
|
6
16
|
* @see docs/DIGITAL_OPTICS_FOUNDATION.md for equations, coordinate/unit conventions, blockers and
|
|
7
17
|
* support limits.
|
|
8
18
|
*/
|
|
@@ -10,6 +20,9 @@ import { approximationResult } from "../core/calculation-result.js";
|
|
|
10
20
|
import { InvalidScientificInputError } from "../core/validation.js";
|
|
11
21
|
import { calculateRadialDistortionMapping, calculateInverseRadialDistortionMapping, validateRadialDistortionProfile } from "../optics/radial-distortion.js";
|
|
12
22
|
import { choice, finite, list, positive, record, textValue } from "../optics/profile-contract.js";
|
|
23
|
+
import { requireInputObject, requireInputKeys } from "../core/record-validation.js";
|
|
24
|
+
import { brownConradyForwardValue, brownConradyInverseValue, validateBrownConradyDistortionProfile } from "../optics/brown-conrady-distortion.js";
|
|
25
|
+
import { lensProjectionRemapValue, lensProjectionSignedAxisAngle, parseLensProjectionModel } from "../camera/lens-projection.js";
|
|
13
26
|
function point(value) {
|
|
14
27
|
const p = record(value, ["x", "y"]);
|
|
15
28
|
return { x: finite(p.x, "x"), y: finite(p.y, "y") };
|
|
@@ -28,15 +41,43 @@ function inverse(m) {
|
|
|
28
41
|
function affine(p, m, o) {
|
|
29
42
|
return { x: m[0] * p.x + m[1] * p.y + o.x, y: m[2] * p.x + m[3] * p.y + o.y };
|
|
30
43
|
}
|
|
31
|
-
/**
|
|
44
|
+
/** Strictly parses transform data. Unknown kinds or fields and profiles that cannot be inverted are rejected. */
|
|
32
45
|
export function parseDigitalGeometricTransform(value) {
|
|
33
|
-
const r = record(value, ["id", "version", "domain", "purpose", "kind", "matrix", "offsetMm", "profile"
|
|
46
|
+
const r = record(value, ["id", "version", "domain", "purpose", "kind", "matrix", "offsetMm", "profile",
|
|
47
|
+
"destinationProjection", "sourceProjection"]);
|
|
34
48
|
const identity = {
|
|
35
49
|
id: textValue(r.id), version: textValue(r.version),
|
|
36
50
|
domain: choice(r.domain, ["raw-channel", "reconstructed-linear", "processed-output"]),
|
|
37
|
-
purpose: choice(r.purpose, ["distortion", "breathing", "digital-stabilization", "orientation-crop", "lateral-ca"])
|
|
51
|
+
purpose: choice(r.purpose, ["distortion", "breathing", "digital-stabilization", "orientation-crop", "lateral-ca", "projection"])
|
|
38
52
|
};
|
|
39
|
-
const kind = choice(r.kind, ["affine", "radial"]);
|
|
53
|
+
const kind = choice(r.kind, ["affine", "radial", "brown-conrady", "projection-remap"]);
|
|
54
|
+
if ((kind === "projection-remap") !== (identity.purpose === "projection")) {
|
|
55
|
+
throw new InvalidScientificInputError("Purpose \"projection\" is used exactly by projection-remap transforms.");
|
|
56
|
+
}
|
|
57
|
+
if (kind !== "projection-remap" && (r.destinationProjection !== undefined || r.sourceProjection !== undefined)) {
|
|
58
|
+
throw new InvalidScientificInputError("Only projection-remap transforms carry projection declarations.");
|
|
59
|
+
}
|
|
60
|
+
if (kind === "projection-remap") {
|
|
61
|
+
if (r.matrix !== undefined || r.offsetMm !== undefined || r.profile !== undefined) {
|
|
62
|
+
throw new InvalidScientificInputError("Projection remap cannot contain affine or distortion fields.");
|
|
63
|
+
}
|
|
64
|
+
const projection = (v) => {
|
|
65
|
+
const d = record(v, ["projectionModel", "focalLengthMm"]);
|
|
66
|
+
return { projectionModel: parseLensProjectionModel(d.projectionModel), focalLengthMm: positive(d.focalLengthMm, "focalLengthMm") };
|
|
67
|
+
};
|
|
68
|
+
return { ...identity, kind, destinationProjection: projection(r.destinationProjection), sourceProjection: projection(r.sourceProjection) };
|
|
69
|
+
}
|
|
70
|
+
if (kind === "brown-conrady") {
|
|
71
|
+
if (r.matrix !== undefined || r.offsetMm !== undefined)
|
|
72
|
+
throw new InvalidScientificInputError("Brown-Conrady map cannot contain affine fields.");
|
|
73
|
+
const p = record(r.profile, ["normalizationRadiusMm", "maximumNormalizedRadius", "coefficients"]);
|
|
74
|
+
const c = record(p.coefficients, ["k1", "k2", "k3", "p1", "p2"]);
|
|
75
|
+
const profile = { normalizationRadiusMm: positive(p.normalizationRadiusMm, "normalizationRadiusMm"),
|
|
76
|
+
maximumNormalizedRadius: positive(p.maximumNormalizedRadius, "maximumNormalizedRadius"),
|
|
77
|
+
coefficients: { k1: finite(c.k1, "k1"), k2: finite(c.k2, "k2"), k3: finite(c.k3, "k3"), p1: finite(c.p1, "p1"), p2: finite(c.p2, "p2") } };
|
|
78
|
+
validateBrownConradyDistortionProfile(profile);
|
|
79
|
+
return { ...identity, kind, profile };
|
|
80
|
+
}
|
|
40
81
|
if (kind === "affine") {
|
|
41
82
|
if (r.profile !== undefined)
|
|
42
83
|
throw new InvalidScientificInputError("Affine map cannot contain radial profile.");
|
|
@@ -57,8 +98,9 @@ export function parseDigitalGeometricTransform(value) {
|
|
|
57
98
|
validateRadialDistortionProfile(profile);
|
|
58
99
|
return { ...identity, kind, profile };
|
|
59
100
|
}
|
|
60
|
-
/** Prepares deterministic still
|
|
101
|
+
/** Prepares a deterministic mapping for one still or frame. A change in time needs a new preparation. */
|
|
61
102
|
export function prepareGeometricMapping(input) {
|
|
103
|
+
requireInputKeys(input, "prepareGeometricMapping", ["transforms", "frameTimeSeconds"]);
|
|
62
104
|
const time = finite(input.frameTimeSeconds, "frameTimeSeconds");
|
|
63
105
|
if (time < 0)
|
|
64
106
|
throw new InvalidScientificInputError("Time is seconds from exposure start.");
|
|
@@ -73,15 +115,35 @@ export function prepareGeometricMapping(input) {
|
|
|
73
115
|
else
|
|
74
116
|
groups.push({ domain: t.domain, componentIds: [t.id] });
|
|
75
117
|
}
|
|
76
|
-
|
|
77
|
-
|
|
118
|
+
const version = transforms.some((t) => t.kind === "brown-conrady" || t.kind === "projection-remap") ? "0.2.0" : "0.1.0";
|
|
119
|
+
return approximationResult({ schemaVersion: version, frameTimeSeconds: time, transforms,
|
|
120
|
+
semanticKey: JSON.stringify({ frameTimeSeconds: time, transforms }), groups }, "composed-digital-geometry", version, ["Explicit inverse maps; incompatible domains require separate image stages", "No physical PSF, photon or noise-history recalculation"]);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Re-validates a prepared mapping from its defining fields (transforms and frame time). Its derived
|
|
124
|
+
* fields (schema version, semantic key, groups) are recomputed, never trusted.
|
|
125
|
+
*/
|
|
126
|
+
function reprepareGeometricMapping(mapping) {
|
|
127
|
+
requireInputObject(mapping, "prepareGeometricMapping input");
|
|
128
|
+
return prepareGeometricMapping({ transforms: mapping.transforms, frameTimeSeconds: mapping.frameTimeSeconds }).value;
|
|
78
129
|
}
|
|
79
|
-
/**
|
|
130
|
+
/** Maps a display point to the capture, with the full local derivatives in each direction. */
|
|
80
131
|
export function calculateComposedGeometricMapping(input) {
|
|
81
|
-
|
|
132
|
+
requireInputKeys(input, "calculateComposedGeometricMapping", ["mapping", "destinationPointMm"]);
|
|
133
|
+
const mapping = reprepareGeometricMapping(input.mapping);
|
|
82
134
|
return calculatePreparedGeometricMappingPoint(mapping, input.destinationPointMm);
|
|
83
135
|
}
|
|
84
|
-
/**
|
|
136
|
+
/** Only a mapping parsed and copied within this call; prepared state from outside is never accepted. */
|
|
137
|
+
const VALIDATED_BROWN_CONRADY = new WeakMap();
|
|
138
|
+
/** Validates a parsed transform's profile once per prepared mapping (the transform object is call-local). */
|
|
139
|
+
function validatedBrownConrady(t) {
|
|
140
|
+
let v = VALIDATED_BROWN_CONRADY.get(t);
|
|
141
|
+
if (v === undefined) {
|
|
142
|
+
v = validateBrownConradyDistortionProfile(t.profile);
|
|
143
|
+
VALIDATED_BROWN_CONRADY.set(t, v);
|
|
144
|
+
}
|
|
145
|
+
return v;
|
|
146
|
+
}
|
|
85
147
|
function calculatePreparedGeometricMappingPoint(mapping, destinationPointMm) {
|
|
86
148
|
let p = point(destinationPointMm);
|
|
87
149
|
let j = [1, 0, 0, 1];
|
|
@@ -89,10 +151,20 @@ function calculatePreparedGeometricMappingPoint(mapping, destinationPointMm) {
|
|
|
89
151
|
for (const t of mapping.transforms) {
|
|
90
152
|
let local;
|
|
91
153
|
if (t.kind === "affine") {
|
|
92
|
-
//
|
|
154
|
+
// Give each point its own result arrays when one mapping serves many points.
|
|
93
155
|
local = [...t.matrix];
|
|
94
156
|
p = affine(p, local, t.offsetMm);
|
|
95
157
|
}
|
|
158
|
+
else if (t.kind === "brown-conrady") {
|
|
159
|
+
const mapped = brownConradyForwardValue(validatedBrownConrady(t), p);
|
|
160
|
+
local = [...mapped.jacobian];
|
|
161
|
+
p = mapped.mappedImagePointMm;
|
|
162
|
+
}
|
|
163
|
+
else if (t.kind === "projection-remap") {
|
|
164
|
+
const mapped = lensProjectionRemapValue(t.destinationProjection.projectionModel, t.destinationProjection.focalLengthMm, t.sourceProjection.projectionModel, t.sourceProjection.focalLengthMm, p.x, p.y);
|
|
165
|
+
local = [...mapped.jacobian];
|
|
166
|
+
p = { ...mapped.sourcePointMm };
|
|
167
|
+
}
|
|
96
168
|
else {
|
|
97
169
|
const { k1, k2, k3 } = t.profile.coefficients;
|
|
98
170
|
const r2 = (p.x * p.x + p.y * p.y) / t.profile.normalizationRadiusMm ** 2;
|
|
@@ -104,21 +176,27 @@ function calculatePreparedGeometricMappingPoint(mapping, destinationPointMm) {
|
|
|
104
176
|
j = multiply(local, j);
|
|
105
177
|
components.push({ id: t.id, sourcePointMm: { ...p }, jacobian: local });
|
|
106
178
|
}
|
|
107
|
-
// Singular values
|
|
179
|
+
// Singular values from the eigenvalues of the symmetric matrix JᵀJ. Computing the smaller one as
|
|
180
|
+
// det/smax avoids cancellation error.
|
|
108
181
|
const a = j[0] * j[0] + j[2] * j[2], b = j[0] * j[1] + j[2] * j[3], c = j[1] * j[1] + j[3] * j[3];
|
|
109
182
|
const maximum = Math.sqrt((a + c + Math.hypot(a - c, 2 * b)) / 2);
|
|
110
183
|
const det = determinant(j), minimum = Math.abs(det) / maximum;
|
|
111
184
|
return approximationResult({ sourcePointMm: p, jacobian: j, determinant: det,
|
|
112
185
|
principalStretches: [maximum, minimum], anisotropy: maximum / minimum, components }, "composed-digital-geometry-point", "0.1.0", ["Jacobian warps already-formed blur and noise; it creates no captured detail"]);
|
|
113
186
|
}
|
|
114
|
-
/**
|
|
187
|
+
/** Maps a capture point to the display, for focus, metering and overlays. It inverts the same maps. */
|
|
115
188
|
export function calculateForwardGeometricMapping(input) {
|
|
189
|
+
requireInputKeys(input, "calculateForwardGeometricMapping", ["mapping", "sourcePointMm"]);
|
|
116
190
|
let p = point(input.sourcePointMm);
|
|
117
|
-
const mapping =
|
|
191
|
+
const mapping = reprepareGeometricMapping(input.mapping);
|
|
118
192
|
for (const t of [...mapping.transforms].reverse()) {
|
|
119
193
|
p = t.kind === "affine"
|
|
120
194
|
? affine({ x: p.x - t.offsetMm.x, y: p.y - t.offsetMm.y }, inverse(t.matrix), { x: 0, y: 0 })
|
|
121
|
-
:
|
|
195
|
+
: t.kind === "brown-conrady"
|
|
196
|
+
? brownConradyInverseValue(validatedBrownConrady(t), p)
|
|
197
|
+
: t.kind === "projection-remap"
|
|
198
|
+
? lensProjectionRemapValue(t.sourceProjection.projectionModel, t.sourceProjection.focalLengthMm, t.destinationProjection.projectionModel, t.destinationProjection.focalLengthMm, p.x, p.y).sourcePointMm
|
|
199
|
+
: calculateInverseRadialDistortionMapping({ distortedImagePointMm: p, profile: t.profile }).value.sourceImagePointMm;
|
|
122
200
|
}
|
|
123
201
|
return approximationResult(p, "forward-digital-geometry-bridge", "0.1.0", ["Inverse of the authoritative destination-to-source geometry"]);
|
|
124
202
|
}
|
|
@@ -166,9 +244,10 @@ export function calculateValidSourceCrop(mask, width, height) {
|
|
|
166
244
|
}
|
|
167
245
|
return best;
|
|
168
246
|
}
|
|
169
|
-
/**
|
|
247
|
+
/** Composes compatible inverse maps, then resolves one shared plan for validity, crop and anti-aliasing (AA). */
|
|
170
248
|
export function calculateGeometricSamplingPlan(input) {
|
|
171
|
-
|
|
249
|
+
requireInputKeys(input, "calculateGeometricSamplingPlan", ["mapping", "sourceRaster", "destinationRaster", "resampler", "physicalProjectionDistanceMm", "sourceProjectionModel"]);
|
|
250
|
+
const mapping = reprepareGeometricMapping(input.mapping);
|
|
172
251
|
if (mapping.groups.length > 1)
|
|
173
252
|
throw new InvalidScientificInputError("Separate incompatible-domain groups before resampling.");
|
|
174
253
|
const source = parseGeometricRaster(input.sourceRaster), destination = parseGeometricRaster(input.destinationRaster);
|
|
@@ -185,7 +264,10 @@ export function calculateGeometricSamplingPlan(input) {
|
|
|
185
264
|
}
|
|
186
265
|
const requiresPrefilter = points.some((p) => p.principalStretches[0] * destination.pitchMm / source.pitchMm > 1 + 1e-12);
|
|
187
266
|
const crop = calculateValidSourceCrop(mask, destination.width, destination.height);
|
|
188
|
-
const
|
|
267
|
+
const sourceModel = input.sourceProjectionModel === undefined ? "rectilinear" : parseLensProjectionModel(input.sourceProjectionModel);
|
|
268
|
+
const angle = sourceModel === "rectilinear"
|
|
269
|
+
? (mm) => Math.atan(mm / projection) * 180 / Math.PI
|
|
270
|
+
: (mm) => lensProjectionSignedAxisAngle(sourceModel, projection, mm) * 180 / Math.PI;
|
|
189
271
|
const retained = points.filter((_, i) => crop !== null && i % destination.width >= crop.x &&
|
|
190
272
|
i % destination.width < crop.x + crop.width && Math.floor(i / destination.width) >= crop.y &&
|
|
191
273
|
Math.floor(i / destination.width) < crop.y + crop.height).map((p) => p.sourcePointMm);
|
|
@@ -200,9 +282,14 @@ export function calculateGeometricSamplingPlan(input) {
|
|
|
200
282
|
vertical: angle(source.centerMm.y + source.height * source.pitchMm / 2) - angle(source.centerMm.y - source.height * source.pitchMm / 2)
|
|
201
283
|
}, retainedSampleRayEnvelopeDegrees: envelope }, "joint-geometric-sampling-plan", "0.1.0", ["Mask and crop are exact for this pixel-center lattice/filter, not continuous between-pixel support", "Compression requires explicitly source-prefiltered data; this API does not implement that prefilter", "No temporal trajectory crop guarantee"]);
|
|
202
284
|
}
|
|
203
|
-
/**
|
|
285
|
+
/** Resamples an already-formed single-channel image once. A null output sample marks missing source data. */
|
|
204
286
|
export function calculateGeometricResampling(input) {
|
|
205
|
-
|
|
287
|
+
requireInputKeys(input, "calculateGeometricResampling", ["plan", "sourceSamples"]);
|
|
288
|
+
const prior = input.plan;
|
|
289
|
+
requireInputObject(prior, "calculateGeometricResampling plan");
|
|
290
|
+
// Re-plan from the defining fields; the derived plan fields are recomputed, never trusted.
|
|
291
|
+
const plan = calculateGeometricSamplingPlan({ mapping: prior.mapping, sourceRaster: prior.sourceRaster,
|
|
292
|
+
destinationRaster: prior.destinationRaster, resampler: prior.resampler, physicalProjectionDistanceMm: 1 }).value;
|
|
206
293
|
if (!plan.canResample)
|
|
207
294
|
throw new InvalidScientificInputError("Compression requires source-prefiltered data.");
|
|
208
295
|
const source = list(input.sourceSamples, 65536).map((v) => finite(v, "source sample"));
|
|
@@ -215,7 +302,7 @@ export function calculateGeometricResampling(input) {
|
|
|
215
302
|
if (plan.resampler.filter === "nearest")
|
|
216
303
|
return source[Math.round(q.y) * width + Math.round(q.x)];
|
|
217
304
|
const x = Math.floor(q.x), y = Math.floor(q.y), dx = q.x - x, dy = q.y - y;
|
|
218
|
-
//
|
|
305
|
+
// A centre exactly on the boundary needs no missing neighbour. The border is never extended.
|
|
219
306
|
const x1 = dx === 0 ? x : x + 1, y1 = dy === 0 ? y : y + 1;
|
|
220
307
|
return (1 - dy) * ((1 - dx) * source[y * width + x] + dx * source[y * width + x1]) +
|
|
221
308
|
dy * ((1 - dx) * source[y1 * width + x] + dx * source[y1 * width + x1]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometric-transforms.js","sourceRoot":"","sources":["../../src/output/geometric-transforms.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAA0B,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,gCAAgC,EAAE,uCAAuC,EACzE,+BAA+B,EAChC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAuElG,SAAS,KAAK,CAAC,KAAc;IAC3B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACtD,CAAC;AACD,SAAS,QAAQ,CAAC,CAAoB,EAAE,CAAoB;IAC1D,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC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AAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC;QACvE,6FAA6F;QAC7F,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC;QACvD,OAAO,CAAC,CAAC,GAAC,EAAE,CAAC,GAAC,CAAC,CAAC,CAAC,GAAC,EAAE,CAAC,GAAC,MAAM,CAAC,CAAC,GAAC,KAAK,GAAC,CAAC,CAAE,GAAC,EAAE,GAAC,MAAM,CAAC,CAAC,GAAC,KAAK,GAAC,EAAE,CAAE,CAAC;YAC9D,EAAE,GAAC,CAAC,CAAC,CAAC,GAAC,EAAE,CAAC,GAAC,MAAM,CAAC,EAAE,GAAC,KAAK,GAAC,CAAC,CAAE,GAAC,EAAE,GAAC,MAAM,CAAC,EAAE,GAAC,KAAK,GAAC,EAAE,CAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,mBAAmB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,EAClF,kCAAkC,EAAE,OAAO,EAAE,CAAC,iEAAiE,CAAC,CAAC,CAAC;AACtH,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Geometric image transforms (warps) such as distortion correction and projection changes, and\n * a resampler that applies them.\n *\n * A mapping goes from destination (output) points to source (captured) points. Preparing a\n * mapping fixes it for one still or frame; a change in time needs a new preparation.\n *\n * Transform kinds:\n * - `affine` and `radial` (schema 0.1.0, unchanged).\n * - From mapping schema 0.2.0: `brown-conrady` (radial plus tangential lens distortion) and\n * `projection-remap` (a change of ideal projection, for example fisheye capture to a\n * rectilinear or equirectangular view).\n *\n * A mapping that uses only 0.1.0 kinds keeps schema and model version 0.1.0 and gives identical output.\n * @see docs/DIGITAL_OPTICS_FOUNDATION.md for equations, coordinate/unit conventions, blockers and\n * support limits.\n */\n\nimport { approximationResult, type CalculationResult } from \"../core/calculation-result.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport {\n calculateRadialDistortionMapping, calculateInverseRadialDistortionMapping,\n validateRadialDistortionProfile, type RadialDistortionProfile, type LensFieldPointMm\n} from \"../optics/radial-distortion.js\";\nimport { choice, finite, list, positive, record, textValue } from \"../optics/profile-contract.js\";\nimport { requireInputObject, requireInputKeys } from \"../core/record-validation.js\";\nimport {\n brownConradyForwardValue, brownConradyInverseValue, validateBrownConradyDistortionProfile,\n type BrownConradyDistortionProfile, type ValidatedBrownConradyDistortionProfile\n} from \"../optics/brown-conrady-distortion.js\";\nimport {\n lensProjectionRemapValue, lensProjectionSignedAxisAngle, parseLensProjectionModel,\n type LensProjectionModel\n} from \"../camera/lens-projection.js\";\n\n/** A domain change separates maps: only adjacent maps in the same domain share one resampling pass. */\nexport type GeometricImageDomain = \"raw-channel\" | \"reconstructed-linear\" | \"processed-output\";\n/** Jacobian (derivative) d(source mm)/d(destination mm), in row-major order. */\nexport type GeometricJacobian = readonly [number, number, number, number];\ninterface TransformIdentity {\n id: string;\n version: string;\n domain: GeometricImageDomain;\n purpose: \"distortion\" | \"breathing\" | \"digital-stabilization\" | \"orientation-crop\" | \"lateral-ca\" | \"projection\";\n}\n/** Explicit destination-to-source affine map, which can include rotation, shear and offset. */\nexport interface AffineGeometricTransform extends TransformIdentity {\n kind: \"affine\";\n matrix: GeometricJacobian;\n offsetMm: LensFieldPointMm;\n}\n/** Radial distortion. A correction reads the physically distorted data at the position mapped from each ideal (undistorted) destination point. */\nexport interface RadialGeometricTransform extends TransformIdentity {\n kind: \"radial\";\n profile: RadialDistortionProfile;\n}\n/** Schema 0.2.0: Brown-Conrady distortion. A correction reads the distorted data at the position mapped from each ideal destination point. */\nexport interface BrownConradyGeometricTransform extends TransformIdentity {\n kind: \"brown-conrady\";\n profile: BrownConradyDistortionProfile;\n}\n/** One ideal projection and its mapping scale (focal length, or mm per radian for equirectangular). */\nexport interface GeometricProjectionDeclaration {\n projectionModel: LensProjectionModel;\n focalLengthMm: number;\n}\n/**\n * Schema 0.2.0: change of projection. Each destination point becomes a scene direction (using\n * the destination projection), then a source point (using the source projection). Purpose must\n * be \"projection\".\n */\nexport interface ProjectionRemapGeometricTransform extends TransformIdentity {\n kind: \"projection-remap\";\n destinationProjection: GeometricProjectionDeclaration;\n sourceProjection: GeometricProjectionDeclaration;\n}\nexport type DigitalGeometricTransform =\n | AffineGeometricTransform\n | RadialGeometricTransform\n | BrownConradyGeometricTransform\n | ProjectionRemapGeometricTransform;\n/** Serializable prepared mapping. Maps are applied in the listed order, from destination towards source. */\nexport interface PreparedGeometricMapping {\n /** 0.1.0 when only affine and radial kinds are used; 0.2.0 when a kind added in 2.0 is present. */\n schemaVersion: \"0.1.0\" | \"0.2.0\";\n frameTimeSeconds: number;\n transforms: readonly DigitalGeometricTransform[];\n semanticKey: string;\n groups: readonly { domain: GeometricImageDomain; componentIds: readonly string[] }[];\n}\n/** A regular grid of pixel centres on the optical plane: +X right, +Y up; rows run top to bottom. */\nexport interface GeometricRaster {\n width: number;\n height: number;\n centerMm: LensFieldPointMm;\n pitchMm: number;\n}\n/** The resampling filter, chosen independently of the mapping. Any prefiltering (anti-aliasing) is the caller's job. */\nexport interface GeometricResampler {\n id: string;\n version: string;\n filter: \"nearest\" | \"bilinear\";\n antialias: \"none\" | \"source-prefiltered\";\n}\nexport interface GeometricMappingPoint {\n sourcePointMm: LensFieldPointMm;\n jacobian: GeometricJacobian;\n determinant: number;\n principalStretches: readonly [number, number];\n anisotropy: number;\n components: readonly { id: string; sourcePointMm: LensFieldPointMm; jacobian: GeometricJacobian }[];\n}\nexport interface GeometricSamplingPlan {\n mapping: PreparedGeometricMapping;\n sourceRaster: GeometricRaster;\n destinationRaster: GeometricRaster;\n resampler: GeometricResampler;\n points: readonly GeometricMappingPoint[];\n /** True where the selected filter has full source support around the pixel centre. Edges are not extended. */\n validSourceMask: readonly boolean[];\n /** Largest axis-aligned rectangle of valid pixels (half-open). Null if there is none. */\n jointCrop: { x: number; y: number; width: number; height: number } | null;\n requiresPrefilter: boolean;\n canResample: boolean;\n physicalCapturedFovDegrees: { horizontal: number; vertical: number };\n /** Angular extent of the mapped pixel-centre rays kept by the joint crop. It is not the edge-to-edge FOV. */\n retainedSampleRayEnvelopeDegrees: { minX: number; maxX: number; minY: number; maxY: number } | null;\n}\n\nfunction point(value: unknown): LensFieldPointMm {\n const p = record(value, [\"x\", \"y\"]);\n return { x: finite(p.x, \"x\"), y: finite(p.y, \"y\") };\n}\nfunction multiply(a: GeometricJacobian, b: GeometricJacobian): GeometricJacobian {\n return [a[0]*b[0]+a[1]*b[2], a[0]*b[1]+a[1]*b[3],\n a[2]*b[0]+a[3]*b[2], a[2]*b[1]+a[3]*b[3]];\n}\nfunction determinant(m: GeometricJacobian): number { return m[0]*m[3]-m[1]*m[2]; }\nfunction inverse(m: GeometricJacobian): GeometricJacobian {\n const d = determinant(m);\n if (!Number.isFinite(d) || Math.abs(d) < 1e-12) throw new InvalidScientificInputError(\"Singular or ill-conditioned affine map.\");\n return [m[3]/d, -m[1]/d, -m[2]/d, m[0]/d];\n}\nfunction affine(p: LensFieldPointMm, m: GeometricJacobian, o: LensFieldPointMm): LensFieldPointMm {\n return { x: m[0]*p.x+m[1]*p.y+o.x, y: m[2]*p.x+m[3]*p.y+o.y };\n}\n/** Strictly parses transform data. Unknown kinds or fields and profiles that cannot be inverted are rejected. */\nexport function parseDigitalGeometricTransform(value: unknown): DigitalGeometricTransform {\n const r = record(value, [\"id\", \"version\", \"domain\", \"purpose\", \"kind\", \"matrix\", \"offsetMm\", \"profile\",\n \"destinationProjection\", \"sourceProjection\"]);\n const identity = {\n id: textValue(r.id), version: textValue(r.version),\n domain: choice(r.domain, [\"raw-channel\", \"reconstructed-linear\", \"processed-output\"]),\n purpose: choice(r.purpose, [\"distortion\", \"breathing\", \"digital-stabilization\", \"orientation-crop\", \"lateral-ca\", \"projection\"])\n };\n const kind = choice(r.kind, [\"affine\", \"radial\", \"brown-conrady\", \"projection-remap\"]);\n if ((kind === \"projection-remap\") !== (identity.purpose === \"projection\")) {\n throw new InvalidScientificInputError(\"Purpose \\\"projection\\\" is used exactly by projection-remap transforms.\");\n }\n if (kind !== \"projection-remap\" && (r.destinationProjection !== undefined || r.sourceProjection !== undefined)) {\n throw new InvalidScientificInputError(\"Only projection-remap transforms carry projection declarations.\");\n }\n if (kind === \"projection-remap\") {\n if (r.matrix !== undefined || r.offsetMm !== undefined || r.profile !== undefined) {\n throw new InvalidScientificInputError(\"Projection remap cannot contain affine or distortion fields.\");\n }\n const projection = (v: unknown): GeometricProjectionDeclaration => {\n const d = record(v, [\"projectionModel\", \"focalLengthMm\"]);\n return { projectionModel: parseLensProjectionModel(d.projectionModel), focalLengthMm: positive(d.focalLengthMm, \"focalLengthMm\") };\n };\n return { ...identity, kind, destinationProjection: projection(r.destinationProjection), sourceProjection: projection(r.sourceProjection) };\n }\n if (kind === \"brown-conrady\") {\n if (r.matrix !== undefined || r.offsetMm !== undefined) throw new InvalidScientificInputError(\"Brown-Conrady map cannot contain affine fields.\");\n const p = record(r.profile, [\"normalizationRadiusMm\", \"maximumNormalizedRadius\", \"coefficients\"]);\n const c = record(p.coefficients, [\"k1\", \"k2\", \"k3\", \"p1\", \"p2\"]);\n const profile = { normalizationRadiusMm: positive(p.normalizationRadiusMm, \"normalizationRadiusMm\"),\n maximumNormalizedRadius: positive(p.maximumNormalizedRadius, \"maximumNormalizedRadius\"),\n coefficients: { k1: finite(c.k1, \"k1\"), k2: finite(c.k2, \"k2\"), k3: finite(c.k3, \"k3\"), p1: finite(c.p1, \"p1\"), p2: finite(c.p2, \"p2\") } };\n validateBrownConradyDistortionProfile(profile);\n return { ...identity, kind, profile };\n }\n if (kind === \"affine\") {\n if (r.profile !== undefined) throw new InvalidScientificInputError(\"Affine map cannot contain radial profile.\");\n const entries = list(r.matrix, 4).map((v) => finite(v, \"matrix\"));\n if (entries.length !== 4) throw new InvalidScientificInputError(\"Matrix must have four entries.\");\n const matrix = entries as [number, number, number, number];\n inverse(matrix);\n return { ...identity, kind, matrix, offsetMm: point(r.offsetMm) };\n }\n if (r.matrix !== undefined || r.offsetMm !== undefined) throw new InvalidScientificInputError(\"Radial map cannot contain affine fields.\");\n const p = record(r.profile, [\"normalizationRadiusMm\", \"maximumNormalizedRadius\", \"coefficients\"]);\n const c = record(p.coefficients, [\"k1\", \"k2\", \"k3\"]);\n const profile = { normalizationRadiusMm: positive(p.normalizationRadiusMm, \"normalizationRadiusMm\"),\n maximumNormalizedRadius: positive(p.maximumNormalizedRadius, \"maximumNormalizedRadius\"),\n coefficients: { k1: finite(c.k1, \"k1\"), k2: finite(c.k2, \"k2\"), k3: finite(c.k3, \"k3\") } };\n validateRadialDistortionProfile(profile);\n return { ...identity, kind, profile };\n}\n\n/** Prepares a deterministic mapping for one still or frame. A change in time needs a new preparation. */\nexport function prepareGeometricMapping(input: {\n transforms: readonly DigitalGeometricTransform[]; frameTimeSeconds: number;\n}): CalculationResult<PreparedGeometricMapping> {\n requireInputKeys(input, \"prepareGeometricMapping\", [\"transforms\", \"frameTimeSeconds\"]);\n const time = finite(input.frameTimeSeconds, \"frameTimeSeconds\");\n if (time < 0) throw new InvalidScientificInputError(\"Time is seconds from exposure start.\");\n const transforms = list(input.transforms, 32).map(parseDigitalGeometricTransform);\n if (new Set(transforms.map((t) => t.id)).size !== transforms.length) throw new InvalidScientificInputError(\"Duplicate transform IDs.\");\n const groups: { domain: GeometricImageDomain; componentIds: string[] }[] = [];\n for (const t of transforms) {\n const last = groups.at(-1);\n if (last?.domain === t.domain) last.componentIds.push(t.id);\n else groups.push({ domain: t.domain, componentIds: [t.id] });\n }\n const version = transforms.some((t) => t.kind === \"brown-conrady\" || t.kind === \"projection-remap\") ? \"0.2.0\" as const : \"0.1.0\" as const;\n return approximationResult({ schemaVersion: version, frameTimeSeconds: time, transforms,\n semanticKey: JSON.stringify({ frameTimeSeconds: time, transforms }), groups },\n \"composed-digital-geometry\", version, [\"Explicit inverse maps; incompatible domains require separate image stages\", \"No physical PSF, photon or noise-history recalculation\"]);\n}\n\n/**\n * Re-validates a prepared mapping from its defining fields (transforms and frame time). Its derived\n * fields (schema version, semantic key, groups) are recomputed, never trusted.\n */\nfunction reprepareGeometricMapping(mapping: PreparedGeometricMapping): PreparedGeometricMapping {\n requireInputObject(mapping, \"prepareGeometricMapping input\");\n return prepareGeometricMapping({ transforms: mapping.transforms, frameTimeSeconds: mapping.frameTimeSeconds }).value;\n}\n\n/** Maps a display point to the capture, with the full local derivatives in each direction. */\nexport function calculateComposedGeometricMapping(input: {\n mapping: PreparedGeometricMapping; destinationPointMm: LensFieldPointMm;\n}): CalculationResult<GeometricMappingPoint> {\n requireInputKeys(input, \"calculateComposedGeometricMapping\", [\"mapping\", \"destinationPointMm\"]);\n const mapping = reprepareGeometricMapping(input.mapping);\n return calculatePreparedGeometricMappingPoint(mapping, input.destinationPointMm);\n}\n\n/** Only a mapping parsed and copied within this call; prepared state from outside is never accepted. */\nconst VALIDATED_BROWN_CONRADY = new WeakMap<BrownConradyGeometricTransform, ValidatedBrownConradyDistortionProfile>();\n/** Validates a parsed transform's profile once per prepared mapping (the transform object is call-local). */\nfunction validatedBrownConrady(t: BrownConradyGeometricTransform): ValidatedBrownConradyDistortionProfile {\n let v = VALIDATED_BROWN_CONRADY.get(t);\n if (v === undefined) { v = validateBrownConradyDistortionProfile(t.profile); VALIDATED_BROWN_CONRADY.set(t, v); }\n return v;\n}\n\nfunction calculatePreparedGeometricMappingPoint(\n mapping: PreparedGeometricMapping,\n destinationPointMm: LensFieldPointMm\n): CalculationResult<GeometricMappingPoint> {\n let p = point(destinationPointMm);\n let j: GeometricJacobian = [1, 0, 0, 1];\n const components: GeometricMappingPoint[\"components\"][number][] = [];\n for (const t of mapping.transforms) {\n let local: GeometricJacobian;\n if (t.kind === \"affine\") {\n // Give each point its own result arrays when one mapping serves many points.\n local = [...t.matrix];\n p = affine(p, local, t.offsetMm);\n } else if (t.kind === \"brown-conrady\") {\n const mapped = brownConradyForwardValue(validatedBrownConrady(t), p);\n local = [...mapped.jacobian];\n p = mapped.mappedImagePointMm;\n } else if (t.kind === \"projection-remap\") {\n const mapped = lensProjectionRemapValue(t.destinationProjection.projectionModel, t.destinationProjection.focalLengthMm,\n t.sourceProjection.projectionModel, t.sourceProjection.focalLengthMm, p.x, p.y);\n local = [...mapped.jacobian];\n p = { ...mapped.sourcePointMm };\n } else {\n const { k1, k2, k3 } = t.profile.coefficients;\n const r2 = (p.x*p.x+p.y*p.y)/t.profile.normalizationRadiusMm**2;\n const s = 1+k1*r2+k2*r2*r2+k3*r2*r2*r2;\n const d = 2*(k1+2*k2*r2+3*k3*r2*r2)/t.profile.normalizationRadiusMm**2;\n local = [s+d*p.x*p.x, d*p.x*p.y, d*p.x*p.y, s+d*p.y*p.y];\n p = calculateRadialDistortionMapping({ imagePointMm: p, profile: t.profile }).value.mappedImagePointMm;\n }\n j = multiply(local, j);\n components.push({ id: t.id, sourcePointMm: { ...p }, jacobian: local });\n }\n // Singular values from the eigenvalues of the symmetric matrix JᵀJ. Computing the smaller one as\n // det/smax avoids cancellation error.\n const a = j[0]*j[0]+j[2]*j[2], b = j[0]*j[1]+j[2]*j[3], c = j[1]*j[1]+j[3]*j[3];\n const maximum = Math.sqrt((a+c+Math.hypot(a-c, 2*b))/2);\n const det = determinant(j), minimum = Math.abs(det)/maximum;\n return approximationResult({ sourcePointMm: p, jacobian: j, determinant: det,\n principalStretches: [maximum, minimum], anisotropy: maximum/minimum, components },\n \"composed-digital-geometry-point\", \"0.1.0\", [\"Jacobian warps already-formed blur and noise; it creates no captured detail\"]);\n}\n\n/** Maps a capture point to the display, for focus, metering and overlays. It inverts the same maps. */\nexport function calculateForwardGeometricMapping(input: {\n mapping: PreparedGeometricMapping; sourcePointMm: LensFieldPointMm;\n}): CalculationResult<LensFieldPointMm> {\n requireInputKeys(input, \"calculateForwardGeometricMapping\", [\"mapping\", \"sourcePointMm\"]);\n let p = point(input.sourcePointMm);\n const mapping = reprepareGeometricMapping(input.mapping);\n for (const t of [...mapping.transforms].reverse()) {\n p = t.kind === \"affine\"\n ? affine({ x: p.x-t.offsetMm.x, y: p.y-t.offsetMm.y }, inverse(t.matrix), { x: 0, y: 0 })\n : t.kind === \"brown-conrady\"\n ? brownConradyInverseValue(validatedBrownConrady(t), p)\n : t.kind === \"projection-remap\"\n ? lensProjectionRemapValue(t.sourceProjection.projectionModel, t.sourceProjection.focalLengthMm,\n t.destinationProjection.projectionModel, t.destinationProjection.focalLengthMm, p.x, p.y).sourcePointMm\n : calculateInverseRadialDistortionMapping({ distortedImagePointMm: p, profile: t.profile }).value.sourceImagePointMm;\n }\n return approximationResult(p, \"forward-digital-geometry-bridge\", \"0.1.0\", [\"Inverse of the authoritative destination-to-source geometry\"]);\n}\n\n/** @internal Shared lattice validation for downstream correction consumers. */\nexport function parseGeometricRaster(value: unknown): GeometricRaster {\n const r = record(value, [\"width\", \"height\", \"centerMm\", \"pitchMm\"]);\n const width = positive(r.width, \"width\"), height = positive(r.height, \"height\");\n if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width*height > 65536) {\n throw new InvalidScientificInputError(\"Raster must have at most 65536 integral samples.\");\n }\n return { width, height, centerMm: point(r.centerMm), pitchMm: positive(r.pitchMm, \"pitchMm\") };\n}\nfunction pixelPoint(r: GeometricRaster, x: number, y: number): LensFieldPointMm {\n return { x: r.centerMm.x+(x+.5-r.width/2)*r.pitchMm, y: r.centerMm.y-(y+.5-r.height/2)*r.pitchMm };\n}\nfunction pixelCoordinate(r: GeometricRaster, p: LensFieldPointMm): LensFieldPointMm {\n return { x: (p.x-r.centerMm.x)/r.pitchMm+r.width/2-.5, y: (r.centerMm.y-p.y)/r.pitchMm+r.height/2-.5 };\n}\nfunction supported(r: GeometricRaster, p: LensFieldPointMm, filter: GeometricResampler[\"filter\"]): boolean {\n const q = pixelCoordinate(r, p);\n return filter === \"nearest\"\n ? Math.round(q.x) >= 0 && Math.round(q.x) < r.width && Math.round(q.y) >= 0 && Math.round(q.y) < r.height\n : q.x >= 0 && q.x <= r.width-1 && q.y >= 0 && q.y <= r.height-1;\n}\n/** @internal Shared deterministic crop for a validated pixel mask. */\nexport function calculateValidSourceCrop(mask: readonly boolean[], width: number, height: number): GeometricSamplingPlan[\"jointCrop\"] {\n const heights = Array<number>(width).fill(0);\n let best: GeometricSamplingPlan[\"jointCrop\"] = null, area = 0;\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) heights[x] = mask[y*width+x] ? heights[x]!+1 : 0;\n const stack: number[] = [];\n for (let x = 0; x <= width; x++) {\n const h = x === width ? 0 : heights[x]!;\n while (stack.length && heights[stack.at(-1)!]! > h) {\n const index = stack.pop()!, rectangleHeight = heights[index]!;\n const left = stack.length ? stack.at(-1)!+1 : 0, rectangleWidth = x-left;\n if (rectangleHeight*rectangleWidth > area) {\n area = rectangleHeight*rectangleWidth;\n best = { x: left, y: y-rectangleHeight+1, width: rectangleWidth, height: rectangleHeight };\n }\n }\n stack.push(x);\n }\n }\n return best;\n}\n\n/** Composes compatible inverse maps, then resolves one shared plan for validity, crop and anti-aliasing (AA). */\nexport function calculateGeometricSamplingPlan(input: {\n mapping: PreparedGeometricMapping; sourceRaster: GeometricRaster; destinationRaster: GeometricRaster;\n resampler: GeometricResampler; physicalProjectionDistanceMm: number;\n /**\n * Ideal projection of the captured (source) image, used for the reported angles. Omitted or\n * \"rectilinear\" keeps the existing atan(mm / projection distance) angles exactly.\n */\n sourceProjectionModel?: LensProjectionModel;\n}): CalculationResult<GeometricSamplingPlan> {\n requireInputKeys(input, \"calculateGeometricSamplingPlan\", [\"mapping\", \"sourceRaster\", \"destinationRaster\", \"resampler\", \"physicalProjectionDistanceMm\", \"sourceProjectionModel\"]);\n const mapping = reprepareGeometricMapping(input.mapping);\n if (mapping.groups.length > 1) throw new InvalidScientificInputError(\"Separate incompatible-domain groups before resampling.\");\n const source = parseGeometricRaster(input.sourceRaster), destination = parseGeometricRaster(input.destinationRaster);\n const r = record(input.resampler, [\"id\", \"version\", \"filter\", \"antialias\"]);\n const resampler: GeometricResampler = { id: textValue(r.id), version: textValue(r.version),\n filter: choice(r.filter, [\"nearest\", \"bilinear\"]), antialias: choice(r.antialias, [\"none\", \"source-prefiltered\"]) };\n const projection = positive(input.physicalProjectionDistanceMm, \"physicalProjectionDistanceMm\");\n const points: GeometricMappingPoint[] = [], mask: boolean[] = [];\n for (let y = 0; y < destination.height; y++) for (let x = 0; x < destination.width; x++) {\n const mapped = calculatePreparedGeometricMappingPoint(mapping, pixelPoint(destination, x, y)).value;\n points.push(mapped); mask.push(supported(source, mapped.sourcePointMm, resampler.filter));\n }\n const requiresPrefilter = points.some((p) => p.principalStretches[0]*destination.pitchMm/source.pitchMm > 1+1e-12);\n const crop = calculateValidSourceCrop(mask, destination.width, destination.height);\n const sourceModel = input.sourceProjectionModel === undefined ? \"rectilinear\" : parseLensProjectionModel(input.sourceProjectionModel);\n const angle = sourceModel === \"rectilinear\"\n ? (mm: number): number => Math.atan(mm/projection)*180/Math.PI\n : (mm: number): number => lensProjectionSignedAxisAngle(sourceModel, projection, mm)*180/Math.PI;\n const retained = points.filter((_, i) => crop !== null && i%destination.width >= crop.x &&\n i%destination.width < crop.x+crop.width && Math.floor(i/destination.width) >= crop.y &&\n Math.floor(i/destination.width) < crop.y+crop.height).map((p) => p.sourcePointMm);\n const envelope = retained.length ? { minX: Math.min(...retained.map((p) => angle(p.x))),\n maxX: Math.max(...retained.map((p) => angle(p.x))), minY: Math.min(...retained.map((p) => angle(p.y))),\n maxY: Math.max(...retained.map((p) => angle(p.y))) } : null;\n return approximationResult({ mapping, sourceRaster: source, destinationRaster: destination, resampler, points,\n validSourceMask: mask, jointCrop: crop, requiresPrefilter,\n canResample: !requiresPrefilter || resampler.antialias === \"source-prefiltered\",\n physicalCapturedFovDegrees: {\n horizontal: angle(source.centerMm.x+source.width*source.pitchMm/2)-angle(source.centerMm.x-source.width*source.pitchMm/2),\n vertical: angle(source.centerMm.y+source.height*source.pitchMm/2)-angle(source.centerMm.y-source.height*source.pitchMm/2)\n }, retainedSampleRayEnvelopeDegrees: envelope },\n \"joint-geometric-sampling-plan\", \"0.1.0\", [\"Mask and crop are exact for this pixel-center lattice/filter, not continuous between-pixel support\", \"Compression requires explicitly source-prefiltered data; this API does not implement that prefilter\", \"No temporal trajectory crop guarantee\"]);\n}\n\n/** Resamples an already-formed single-channel image once. A null output sample marks missing source data. */\nexport function calculateGeometricResampling(input: {\n plan: GeometricSamplingPlan; sourceSamples: readonly number[];\n}): CalculationResult<{ samples: readonly (number | null)[]; resamplePasses: 1; resampler: GeometricResampler }> {\n requireInputKeys(input, \"calculateGeometricResampling\", [\"plan\", \"sourceSamples\"]);\n const prior = input.plan;\n requireInputObject(prior, \"calculateGeometricResampling plan\");\n // Re-plan from the defining fields; the derived plan fields are recomputed, never trusted.\n const plan = calculateGeometricSamplingPlan({ mapping: prior.mapping, sourceRaster: prior.sourceRaster,\n destinationRaster: prior.destinationRaster, resampler: prior.resampler, physicalProjectionDistanceMm: 1 }).value;\n if (!plan.canResample) throw new InvalidScientificInputError(\"Compression requires source-prefiltered data.\");\n const source = list(input.sourceSamples, 65536).map((v) => finite(v, \"source sample\"));\n if (source.length !== plan.sourceRaster.width*plan.sourceRaster.height) throw new InvalidScientificInputError(\"Source sample count mismatch.\");\n const samples = plan.points.map((p, index): number | null => {\n if (!plan.validSourceMask[index]) return null;\n const q = pixelCoordinate(plan.sourceRaster, p.sourcePointMm), width = plan.sourceRaster.width;\n if (plan.resampler.filter === \"nearest\") return source[Math.round(q.y)*width+Math.round(q.x)]!;\n const x = Math.floor(q.x), y = Math.floor(q.y), dx = q.x-x, dy = q.y-y;\n // A centre exactly on the boundary needs no missing neighbour. The border is never extended.\n const x1 = dx === 0 ? x : x+1, y1 = dy === 0 ? y : y+1;\n return (1-dy)*((1-dx)*source[y*width+x]!+dx*source[y*width+x1]!) +\n dy*((1-dx)*source[y1*width+x]!+dx*source[y1*width+x1]!);\n });\n return approximationResult({ samples, resamplePasses: 1, resampler: plan.resampler },\n \"single-pass-geometric-resampling\", \"0.1.0\", [\"Warps captured blur/noise; does not recalculate the optical PSF\"]);\n}\n"]}
|