@photivra/engine 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +393 -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/host-yield.d.ts +7 -0
- package/dist/facade/host-yield.js +23 -0
- package/dist/facade/host-yield.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +117 -0
- package/dist/facade/scene-radiance.js +205 -0
- package/dist/facade/scene-radiance.js.map +1 -0
- package/dist/facade/simulate-capture.d.ts +284 -0
- package/dist/facade/simulate-capture.js +1026 -0
- package/dist/facade/simulate-capture.js.map +1 -0
- package/dist/gpu/chart-radiance-gpu.d.ts +17 -0
- package/dist/gpu/chart-radiance-gpu.js +176 -0
- package/dist/gpu/chart-radiance-gpu.js.map +1 -0
- package/dist/gpu/image-kernel-accelerator.d.ts +132 -0
- package/dist/gpu/image-kernel-accelerator.js +720 -0
- package/dist/gpu/image-kernel-accelerator.js.map +1 -0
- package/dist/gpu/image-kernel-execution.d.ts +92 -0
- package/dist/gpu/image-kernel-execution.js +84 -0
- package/dist/gpu/image-kernel-execution.js.map +1 -0
- package/dist/gpu/sensor-stage-gpu.d.ts +44 -0
- package/dist/gpu/sensor-stage-gpu.js +317 -0
- package/dist/gpu/sensor-stage-gpu.js.map +1 -0
- package/dist/gpu/temporal-sum-gpu.d.ts +23 -0
- package/dist/gpu/temporal-sum-gpu.js +150 -0
- package/dist/gpu/temporal-sum-gpu.js.map +1 -0
- package/dist/gpu/webgpu-runtime.d.ts +63 -0
- package/dist/gpu/webgpu-runtime.js +215 -0
- package/dist/gpu/webgpu-runtime.js.map +1 -0
- package/dist/gpu/wgsl-chart-kernel.d.ts +30 -0
- package/dist/gpu/wgsl-chart-kernel.js +165 -0
- package/dist/gpu/wgsl-chart-kernel.js.map +1 -0
- package/dist/gpu/wgsl-kernels.d.ts +53 -0
- package/dist/gpu/wgsl-kernels.js +365 -0
- package/dist/gpu/wgsl-kernels.js.map +1 -0
- package/dist/gpu/wgsl-sensor-kernel.d.ts +64 -0
- package/dist/gpu/wgsl-sensor-kernel.js +409 -0
- package/dist/gpu/wgsl-sensor-kernel.js.map +1 -0
- package/dist/index.d.ts +89 -25
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/dist/motion/camera-rotation.d.ts +92 -40
- package/dist/motion/camera-rotation.js +84 -47
- package/dist/motion/camera-rotation.js.map +1 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts +37 -34
- package/dist/motion/capture-rotation-inverse-mapping.js +32 -24
- package/dist/motion/capture-rotation-inverse-mapping.js.map +1 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts +39 -35
- package/dist/motion/capture-rotation-temporal-quadrature.js +37 -28
- package/dist/motion/capture-rotation-temporal-quadrature.js.map +1 -1
- package/dist/motion/capture-rotation-trajectory.d.ts +32 -28
- package/dist/motion/capture-rotation-trajectory.js +36 -26
- package/dist/motion/capture-rotation-trajectory.js.map +1 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts +23 -21
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js +33 -14
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js.map +1 -1
- package/dist/motion/extended-object-projection.d.ts +19 -16
- package/dist/motion/extended-object-projection.js +38 -18
- package/dist/motion/extended-object-projection.js.map +1 -1
- package/dist/motion/projected-motion.d.ts +18 -17
- package/dist/motion/projected-motion.js +25 -17
- package/dist/motion/projected-motion.js.map +1 -1
- package/dist/motion/temporal-exposure-sum.d.ts +55 -0
- package/dist/motion/temporal-exposure-sum.js +141 -0
- package/dist/motion/temporal-exposure-sum.js.map +1 -0
- package/dist/motion/video-sequence.d.ts +111 -0
- package/dist/motion/video-sequence.js +179 -0
- package/dist/motion/video-sequence.js.map +1 -0
- package/dist/optics/aperture.d.ts +14 -15
- package/dist/optics/aperture.js +13 -11
- package/dist/optics/aperture.js.map +1 -1
- package/dist/optics/atmospheric-haze.d.ts +83 -0
- package/dist/optics/atmospheric-haze.js +113 -0
- package/dist/optics/atmospheric-haze.js.map +1 -0
- package/dist/optics/brown-conrady-distortion.d.ts +116 -0
- package/dist/optics/brown-conrady-distortion.js +291 -0
- package/dist/optics/brown-conrady-distortion.js.map +1 -0
- package/dist/optics/circle-of-confusion.d.ts +10 -10
- package/dist/optics/circle-of-confusion.js +15 -11
- package/dist/optics/circle-of-confusion.js.map +1 -1
- package/dist/optics/complex-pupil-psf.d.ts +64 -33
- package/dist/optics/complex-pupil-psf.js +190 -98
- package/dist/optics/complex-pupil-psf.js.map +1 -1
- package/dist/optics/depth-of-field.d.ts +25 -15
- package/dist/optics/depth-of-field.js +67 -27
- package/dist/optics/depth-of-field.js.map +1 -1
- package/dist/optics/diffraction.d.ts +14 -13
- package/dist/optics/diffraction.js +14 -10
- package/dist/optics/diffraction.js.map +1 -1
- package/dist/optics/focus-breathing.d.ts +88 -27
- package/dist/optics/focus-breathing.js +114 -23
- package/dist/optics/focus-breathing.js.map +1 -1
- package/dist/optics/focus-state.d.ts +18 -18
- package/dist/optics/focus-state.js +21 -15
- package/dist/optics/focus-state.js.map +1 -1
- package/dist/optics/front-of-lens-filter.d.ts +45 -14
- package/dist/optics/front-of-lens-filter.js +259 -88
- package/dist/optics/front-of-lens-filter.js.map +1 -1
- package/dist/optics/illumination-vignetting.d.ts +16 -17
- package/dist/optics/illumination-vignetting.js +40 -17
- package/dist/optics/illumination-vignetting.js.map +1 -1
- package/dist/optics/irradiance-convolution.d.ts +59 -0
- package/dist/optics/irradiance-convolution.js +138 -0
- package/dist/optics/irradiance-convolution.js.map +1 -0
- package/dist/optics/lateral-chromatic-aberration.d.ts +33 -30
- package/dist/optics/lateral-chromatic-aberration.js +33 -23
- package/dist/optics/lateral-chromatic-aberration.js.map +1 -1
- package/dist/optics/lens-psf-kernels.d.ts +89 -0
- package/dist/optics/lens-psf-kernels.js +175 -0
- package/dist/optics/lens-psf-kernels.js.map +1 -0
- package/dist/optics/lens-psf-profile.d.ts +78 -46
- package/dist/optics/lens-psf-profile.js +335 -124
- package/dist/optics/lens-psf-profile.js.map +1 -1
- package/dist/optics/longitudinal-chromatic-aberration.d.ts +102 -0
- package/dist/optics/longitudinal-chromatic-aberration.js +210 -0
- package/dist/optics/longitudinal-chromatic-aberration.js.map +1 -0
- package/dist/optics/polygon-diffraction.d.ts +80 -23
- package/dist/optics/polygon-diffraction.js +130 -25
- package/dist/optics/polygon-diffraction.js.map +1 -1
- package/dist/optics/profile-contract.d.ts +5 -6
- package/dist/optics/profile-contract.js +14 -11
- package/dist/optics/profile-contract.js.map +1 -1
- package/dist/optics/psf-foundation.d.ts +23 -23
- package/dist/optics/psf-foundation.js +24 -21
- package/dist/optics/psf-foundation.js.map +1 -1
- package/dist/optics/pupil-vignetting.d.ts +118 -0
- package/dist/optics/pupil-vignetting.js +264 -0
- package/dist/optics/pupil-vignetting.js.map +1 -0
- package/dist/optics/radial-distortion.d.ts +34 -33
- package/dist/optics/radial-distortion.js +37 -30
- package/dist/optics/radial-distortion.js.map +1 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts +47 -33
- package/dist/optics/scene-to-sensor-irradiance.js +73 -45
- package/dist/optics/scene-to-sensor-irradiance.js.map +1 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts +23 -18
- package/dist/optics/scene-to-sensor-quadrature.js +16 -11
- package/dist/optics/scene-to-sensor-quadrature.js.map +1 -1
- package/dist/optics/sensor-aperture-rays.d.ts +20 -4
- package/dist/optics/sensor-aperture-rays.js +32 -14
- package/dist/optics/sensor-aperture-rays.js.map +1 -1
- package/dist/optics/sensor-environment-query.d.ts +81 -16
- package/dist/optics/sensor-environment-query.js +145 -12
- package/dist/optics/sensor-environment-query.js.map +1 -1
- package/dist/optics/sensor-psf-quadrature.d.ts +12 -10
- package/dist/optics/sensor-psf-quadrature.js +18 -11
- package/dist/optics/sensor-psf-quadrature.js.map +1 -1
- package/dist/optics/sensor-psf-support.d.ts +8 -6
- package/dist/optics/sensor-psf-support.js +8 -5
- package/dist/optics/sensor-psf-support.js.map +1 -1
- package/dist/optics/stray-light.d.ts +22 -19
- package/dist/optics/stray-light.js +18 -12
- package/dist/optics/stray-light.js.map +1 -1
- package/dist/optics/thin-lens.d.ts +10 -9
- package/dist/optics/thin-lens.js +12 -8
- package/dist/optics/thin-lens.js.map +1 -1
- package/dist/optics/zernike-wavefront.d.ts +154 -0
- package/dist/optics/zernike-wavefront.js +352 -0
- package/dist/optics/zernike-wavefront.js.map +1 -0
- package/dist/output/capture-corrected-sdr.d.ts +16 -8
- package/dist/output/capture-corrected-sdr.js +16 -8
- package/dist/output/capture-corrected-sdr.js.map +1 -1
- package/dist/output/capture-geometry.d.ts +34 -36
- package/dist/output/capture-geometry.js +52 -32
- package/dist/output/capture-geometry.js.map +1 -1
- package/dist/output/capture-sdr.d.ts +7 -6
- package/dist/output/capture-sdr.js +11 -8
- package/dist/output/capture-sdr.js.map +1 -1
- package/dist/output/crop.d.ts +22 -6
- package/dist/output/crop.js +40 -6
- package/dist/output/crop.js.map +1 -1
- package/dist/output/geometric-transforms.d.ts +60 -23
- package/dist/output/geometric-transforms.js +111 -24
- package/dist/output/geometric-transforms.js.map +1 -1
- package/dist/output/lens-corrections.d.ts +27 -19
- package/dist/output/lens-corrections.js +29 -13
- package/dist/output/lens-corrections.js.map +1 -1
- package/dist/output/native-capture-sdr.d.ts +71 -16
- package/dist/output/native-capture-sdr.js +190 -33
- package/dist/output/native-capture-sdr.js.map +1 -1
- package/dist/output/png-encoder.d.ts +65 -0
- package/dist/output/png-encoder.js +461 -0
- package/dist/output/png-encoder.js.map +1 -0
- package/dist/output/print-contrast-reference.d.ts +10 -9
- package/dist/output/print-contrast-reference.js +10 -8
- package/dist/output/print-contrast-reference.js.map +1 -1
- package/dist/output/print-detail.d.ts +18 -17
- package/dist/output/print-detail.js +12 -10
- package/dist/output/print-detail.js.map +1 -1
- package/dist/output/print-jpeg.d.ts +26 -5
- package/dist/output/print-jpeg.js +117 -50
- package/dist/output/print-jpeg.js.map +1 -1
- package/dist/output/print-plan.d.ts +19 -19
- package/dist/output/print-plan.js +11 -10
- package/dist/output/print-plan.js.map +1 -1
- package/dist/output/print-region-statistics.d.ts +14 -15
- package/dist/output/print-region-statistics.js +11 -11
- package/dist/output/print-region-statistics.js.map +1 -1
- package/dist/output/sdr-rendering.d.ts +48 -10
- package/dist/output/sdr-rendering.js +114 -25
- package/dist/output/sdr-rendering.js.map +1 -1
- package/dist/output/subject-framing-crop.d.ts +6 -10
- package/dist/output/subject-framing-crop.js +23 -13
- package/dist/output/subject-framing-crop.js.map +1 -1
- package/dist/processing/demosaic.d.ts +90 -0
- package/dist/processing/demosaic.js +275 -0
- package/dist/processing/demosaic.js.map +1 -0
- package/dist/processing/denoise.d.ts +68 -0
- package/dist/processing/denoise.js +214 -0
- package/dist/processing/denoise.js.map +1 -0
- package/dist/processing/focus-stacking.d.ts +17 -0
- package/dist/processing/focus-stacking.js +80 -0
- package/dist/processing/focus-stacking.js.map +1 -0
- package/dist/processing/hdr.d.ts +54 -0
- package/dist/processing/hdr.js +172 -0
- package/dist/processing/hdr.js.map +1 -0
- package/dist/processing/image-ops.d.ts +66 -0
- package/dist/processing/image-ops.js +192 -0
- package/dist/processing/image-ops.js.map +1 -0
- package/dist/processing/panorama.d.ts +51 -0
- package/dist/processing/panorama.js +305 -0
- package/dist/processing/panorama.js.map +1 -0
- package/dist/processing/processing-task.d.ts +85 -0
- package/dist/processing/processing-task.js +164 -0
- package/dist/processing/processing-task.js.map +1 -0
- package/dist/processing/tone-mapping.d.ts +69 -0
- package/dist/processing/tone-mapping.js +310 -0
- package/dist/processing/tone-mapping.js.map +1 -0
- package/dist/schema/camera.d.ts +5 -4
- package/dist/schema/illumination-spectral.d.ts +13 -19
- package/dist/schema/illumination-spectral.js +23 -19
- package/dist/schema/illumination-spectral.js.map +1 -1
- package/dist/schema/illumination-temporal.d.ts +12 -15
- package/dist/schema/illumination-temporal.js +43 -28
- package/dist/schema/illumination-temporal.js.map +1 -1
- package/dist/schema/illumination.d.ts +5 -4
- package/dist/schema/illumination.js +55 -20
- package/dist/schema/illumination.js.map +1 -1
- package/dist/schema/scene-radiance-temporal.d.ts +9 -11
- package/dist/schema/scene-radiance-temporal.js +26 -23
- package/dist/schema/scene-radiance-temporal.js.map +1 -1
- package/dist/schema/scene-radiance.d.ts +17 -17
- package/dist/schema/scene-radiance.js +56 -34
- package/dist/schema/scene-radiance.js.map +1 -1
- package/dist/schema/scene.d.ts +14 -13
- package/dist/schema/validation.d.ts +0 -1
- package/dist/schema/validation.js +17 -15
- package/dist/schema/validation.js.map +1 -1
- package/dist/sensor/accumulated-charge.d.ts +45 -64
- package/dist/sensor/accumulated-charge.js +41 -47
- package/dist/sensor/accumulated-charge.js.map +1 -1
- package/dist/sensor/architecture.d.ts +22 -25
- package/dist/sensor/architecture.js +17 -16
- package/dist/sensor/architecture.js.map +1 -1
- package/dist/sensor/camera-saturation-capacity.d.ts +21 -28
- package/dist/sensor/camera-saturation-capacity.js +36 -34
- package/dist/sensor/camera-saturation-capacity.js.map +1 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts +46 -51
- package/dist/sensor/capture-color-sampling-binding.js +39 -41
- package/dist/sensor/capture-color-sampling-binding.js.map +1 -1
- package/dist/sensor/capture-mode-timing.d.ts +8 -9
- package/dist/sensor/capture-mode-timing.js +24 -21
- package/dist/sensor/capture-mode-timing.js.map +1 -1
- package/dist/sensor/capture-mode.d.ts +28 -30
- package/dist/sensor/capture-mode.js +33 -31
- package/dist/sensor/capture-mode.js.map +1 -1
- package/dist/sensor/color-sampling.d.ts +30 -33
- package/dist/sensor/color-sampling.js +32 -37
- package/dist/sensor/color-sampling.js.map +1 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts +19 -23
- package/dist/sensor/constant-rate-temporal-integration.js +28 -26
- package/dist/sensor/constant-rate-temporal-integration.js.map +1 -1
- package/dist/sensor/dark-current.d.ts +53 -49
- package/dist/sensor/dark-current.js +87 -46
- package/dist/sensor/dark-current.js.map +1 -1
- package/dist/sensor/environment-photo-signal.d.ts +71 -30
- package/dist/sensor/environment-photo-signal.js +127 -46
- package/dist/sensor/environment-photo-signal.js.map +1 -1
- package/dist/sensor/eqe-electron-rate.d.ts +14 -13
- package/dist/sensor/eqe-electron-rate.js +34 -14
- package/dist/sensor/eqe-electron-rate.js.map +1 -1
- package/dist/sensor/eqe-local-exposure.d.ts +24 -24
- package/dist/sensor/eqe-local-exposure.js +15 -11
- package/dist/sensor/eqe-local-exposure.js.map +1 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts +11 -11
- package/dist/sensor/eqe-temporal-exposure.js +15 -10
- package/dist/sensor/eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/exposure-window.d.ts +48 -34
- package/dist/sensor/exposure-window.js +77 -36
- package/dist/sensor/exposure-window.js.map +1 -1
- package/dist/sensor/fixed-pattern-noise.d.ts +108 -0
- package/dist/sensor/fixed-pattern-noise.js +166 -0
- package/dist/sensor/fixed-pattern-noise.js.map +1 -0
- package/dist/sensor/iso-gain.d.ts +44 -0
- package/dist/sensor/iso-gain.js +119 -0
- package/dist/sensor/iso-gain.js.map +1 -0
- package/dist/sensor/iso-signal-chain.d.ts +25 -48
- package/dist/sensor/iso-signal-chain.js +52 -66
- package/dist/sensor/iso-signal-chain.js.map +1 -1
- package/dist/sensor/local-exposure-binding.d.ts +21 -21
- package/dist/sensor/local-exposure-binding.js +22 -18
- package/dist/sensor/local-exposure-binding.js.map +1 -1
- package/dist/sensor/optical-stack.d.ts +36 -40
- package/dist/sensor/optical-stack.js +34 -37
- package/dist/sensor/optical-stack.js.map +1 -1
- package/dist/sensor/photon-energy.d.ts +22 -28
- package/dist/sensor/photon-energy.js +42 -34
- package/dist/sensor/photon-energy.js.map +1 -1
- package/dist/sensor/physical-charge-capacity.d.ts +20 -30
- package/dist/sensor/physical-charge-capacity.js +35 -36
- package/dist/sensor/physical-charge-capacity.js.map +1 -1
- package/dist/sensor/pixel-pitch.d.ts +2 -3
- package/dist/sensor/pixel-pitch.js +4 -2
- package/dist/sensor/pixel-pitch.js.map +1 -1
- package/dist/sensor/radiometry-readiness.d.ts +13 -15
- package/dist/sensor/radiometry-readiness.js +20 -17
- package/dist/sensor/radiometry-readiness.js.map +1 -1
- package/dist/sensor/raw-readout.d.ts +173 -83
- package/dist/sensor/raw-readout.js +425 -160
- package/dist/sensor/raw-readout.js.map +1 -1
- package/dist/sensor/raw-reconstruction.d.ts +112 -44
- package/dist/sensor/raw-reconstruction.js +200 -47
- package/dist/sensor/raw-reconstruction.js.map +1 -1
- package/dist/sensor/readout-exposure-linkage.d.ts +103 -34
- package/dist/sensor/readout-exposure-linkage.js +125 -27
- package/dist/sensor/readout-exposure-linkage.js.map +1 -1
- package/dist/sensor/readout-timing.d.ts +43 -44
- package/dist/sensor/readout-timing.js +38 -30
- package/dist/sensor/readout-timing.js.map +1 -1
- package/dist/sensor/response-application-compatibility.d.ts +21 -28
- package/dist/sensor/response-application-compatibility.js +35 -34
- package/dist/sensor/response-application-compatibility.js.map +1 -1
- package/dist/sensor/response-operating-range.d.ts +26 -35
- package/dist/sensor/response-operating-range.js +40 -39
- package/dist/sensor/response-operating-range.js.map +1 -1
- package/dist/sensor/responsivity-photocurrent.d.ts +21 -29
- package/dist/sensor/responsivity-photocurrent.js +57 -40
- package/dist/sensor/responsivity-photocurrent.js.map +1 -1
- package/dist/sensor/sampling-aperture.d.ts +21 -25
- package/dist/sensor/sampling-aperture.js +29 -28
- package/dist/sensor/sampling-aperture.js.map +1 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts +14 -12
- package/dist/sensor/scene-eqe-temporal-exposure.js +13 -8
- package/dist/sensor/scene-eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/sensor-geometry.d.ts +28 -32
- package/dist/sensor/sensor-geometry.js +35 -20
- package/dist/sensor/sensor-geometry.js.map +1 -1
- package/dist/sensor/signal-noise.d.ts +14 -16
- package/dist/sensor/signal-noise.js +15 -13
- package/dist/sensor/signal-noise.js.map +1 -1
- package/dist/sensor/spatial-sample-reduction.d.ts +45 -60
- package/dist/sensor/spatial-sample-reduction.js +39 -48
- package/dist/sensor/spatial-sample-reduction.js.map +1 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts +46 -54
- package/dist/sensor/spatial-sampling-quadrature.js +31 -36
- package/dist/sensor/spatial-sampling-quadrature.js.map +1 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts +32 -42
- package/dist/sensor/spatio-spectral-reduction.js +24 -29
- package/dist/sensor/spatio-spectral-reduction.js.map +1 -1
- package/dist/sensor/spectral-coverage.d.ts +6 -9
- package/dist/sensor/spectral-coverage.js +9 -6
- package/dist/sensor/spectral-coverage.js.map +1 -1
- package/dist/sensor/spectral-quadrature.d.ts +46 -60
- package/dist/sensor/spectral-quadrature.js +38 -48
- package/dist/sensor/spectral-quadrature.js.map +1 -1
- package/dist/sensor/spectral-response.d.ts +53 -41
- package/dist/sensor/spectral-response.js +80 -47
- package/dist/sensor/spectral-response.js.map +1 -1
- package/dist/sensor/stochastic-seed.d.ts +50 -0
- package/dist/sensor/stochastic-seed.js +123 -0
- package/dist/sensor/stochastic-seed.js.map +1 -0
- package/dist/sensor/temporal-eqe-sum.d.ts +2 -4
- package/dist/sensor/temporal-eqe-sum.js +5 -6
- package/dist/sensor/temporal-eqe-sum.js.map +1 -1
- package/dist/sensor/temporal-photo-signal.d.ts +5 -6
- package/dist/sensor/temporal-photo-signal.js +11 -10
- package/dist/sensor/temporal-photo-signal.js.map +1 -1
- package/dist/sensor/temporal-sample-binding.d.ts +1 -2
- package/dist/sensor/temporal-sample-binding.js +3 -3
- package/dist/sensor/temporal-sample-binding.js.map +1 -1
- package/dist/simulation/poc-simulation.d.ts +16 -16
- package/dist/simulation/poc-simulation.js +20 -15
- package/dist/simulation/poc-simulation.js.map +1 -1
- package/dist/stabilization/camera-shake.d.ts +42 -18
- package/dist/stabilization/camera-shake.js +43 -20
- package/dist/stabilization/camera-shake.js.map +1 -1
- package/dist/stabilization/system.d.ts +44 -41
- package/dist/stabilization/system.js +196 -108
- package/dist/stabilization/system.js.map +1 -1
- package/docs/AGENT_GUIDE.md +183 -0
- package/docs/API_REFERENCE.md +761 -2
- package/docs/QUICK_START.md +495 -0
- package/docs/USAGE.md +1719 -714
- package/docs/api/camera-equivalent-focal-length.md +6 -7
- package/docs/api/camera-field-of-view.md +16 -8
- package/docs/api/camera-lens-projection.md +246 -0
- package/docs/api/camera-projected-object-size.md +6 -5
- package/docs/api/capture-capture-export-metadata.md +10 -10
- package/docs/api/capture-dng-import.md +134 -0
- package/docs/api/capture-environment-raw-producer.md +17 -11
- package/docs/api/capture-export-jpeg.md +16 -0
- package/docs/api/capture-focus-control.md +25 -47
- package/docs/api/capture-linear-encoding.md +21 -12
- package/docs/api/capture-lossless-jpeg.md +49 -0
- package/docs/api/capture-native-environment-optical-stage.md +75 -0
- package/docs/api/capture-native-environment-raw.md +161 -4
- package/docs/api/capture-native-raw-development.md +69 -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 +2213 -8
- package/docs/api/exposure-exposure-duration-control.md +9 -9
- package/docs/api/exposure-exposure-mode-resolver.md +35 -31
- package/docs/api/exposure-exposure.md +10 -10
- package/docs/api/exposure-flash-ttl.md +182 -0
- package/docs/api/exposure-flash.md +183 -28
- package/docs/api/exposure-metering-scene-radiance.md +11 -10
- package/docs/api/exposure-metering-target.md +9 -8
- package/docs/api/exposure-metering-temporal.md +8 -8
- package/docs/api/exposure-metering.md +69 -9
- package/docs/api/exposure-program-line.md +6 -5
- package/docs/api/facade-chart-radiance-batch.md +96 -0
- package/docs/api/facade-chart-scenes.md +240 -0
- package/docs/api/facade-scene-radiance.md +122 -0
- package/docs/api/facade-simulate-capture.md +324 -0
- package/docs/api/gpu-image-kernel-accelerator.md +157 -0
- package/docs/api/gpu-image-kernel-execution.md +152 -0
- package/docs/api/motion-camera-rotation.md +43 -26
- package/docs/api/motion-capture-rotation-inverse-mapping.md +24 -23
- package/docs/api/motion-capture-rotation-temporal-quadrature.md +22 -22
- package/docs/api/motion-capture-rotation-trajectory.md +15 -15
- package/docs/api/motion-capture-translation-parallax-temporal-quadrature.md +15 -14
- package/docs/api/motion-extended-object-projection.md +10 -8
- package/docs/api/motion-projected-motion.md +8 -8
- package/docs/api/motion-temporal-exposure-sum.md +98 -0
- package/docs/api/motion-video-sequence.md +159 -0
- package/docs/api/optics-aperture.md +8 -8
- package/docs/api/optics-atmospheric-haze.md +104 -0
- package/docs/api/optics-brown-conrady-distortion.md +123 -0
- package/docs/api/optics-circle-of-confusion.md +5 -4
- package/docs/api/optics-complex-pupil-psf.md +57 -16
- package/docs/api/optics-depth-of-field.md +12 -6
- package/docs/api/optics-diffraction.md +8 -7
- package/docs/api/optics-focus-breathing.md +104 -16
- package/docs/api/optics-focus-state.md +9 -10
- package/docs/api/optics-front-of-lens-filter.md +72 -14
- package/docs/api/optics-illumination-vignetting.md +10 -10
- package/docs/api/optics-irradiance-convolution.md +95 -0
- package/docs/api/optics-lateral-chromatic-aberration.md +22 -21
- package/docs/api/optics-lens-psf-kernels.md +72 -0
- package/docs/api/optics-lens-psf-profile.md +48 -26
- package/docs/api/optics-longitudinal-chromatic-aberration.md +128 -0
- package/docs/api/optics-polygon-diffraction.md +78 -13
- package/docs/api/optics-profile-contract.md +4 -4
- package/docs/api/optics-psf-foundation.md +12 -12
- package/docs/api/optics-pupil-vignetting.md +132 -0
- package/docs/api/optics-radial-distortion.md +12 -12
- package/docs/api/optics-scene-to-sensor-irradiance.md +25 -14
- package/docs/api/optics-scene-to-sensor-quadrature.md +15 -12
- package/docs/api/optics-sensor-aperture-rays.md +3 -2
- package/docs/api/optics-sensor-environment-query.md +52 -9
- package/docs/api/optics-sensor-psf-quadrature.md +13 -10
- package/docs/api/optics-stray-light.md +12 -11
- package/docs/api/optics-thin-lens.md +4 -3
- package/docs/api/optics-zernike-wavefront.md +229 -0
- package/docs/api/output-capture-corrected-sdr.md +10 -7
- package/docs/api/output-capture-geometry.md +35 -36
- package/docs/api/output-capture-sdr.md +4 -4
- package/docs/api/output-crop.md +7 -4
- package/docs/api/output-geometric-transforms.md +65 -19
- package/docs/api/output-lens-corrections.md +17 -15
- package/docs/api/output-native-capture-sdr.md +26 -13
- package/docs/api/output-png-encoder.md +105 -0
- package/docs/api/output-print-contrast-reference.md +8 -8
- package/docs/api/output-print-detail.md +14 -14
- package/docs/api/output-print-jpeg.md +22 -5
- package/docs/api/output-print-plan.md +18 -18
- package/docs/api/output-print-region-statistics.md +14 -14
- package/docs/api/output-sdr-rendering.md +52 -10
- package/docs/api/output-subject-framing-crop.md +5 -6
- package/docs/api/processing-demosaic.md +120 -0
- package/docs/api/processing-denoise.md +148 -0
- package/docs/api/processing-focus-stacking.md +41 -0
- package/docs/api/processing-hdr.md +113 -0
- package/docs/api/processing-panorama.md +82 -0
- package/docs/api/processing-processing-task.md +107 -0
- package/docs/api/processing-tone-mapping.md +142 -0
- package/docs/api/schema-camera.md +6 -4
- package/docs/api/schema-illumination-spectral.md +10 -11
- package/docs/api/schema-illumination-temporal.md +13 -15
- package/docs/api/schema-illumination.md +4 -4
- package/docs/api/schema-scene-radiance-temporal.md +10 -11
- package/docs/api/schema-scene-radiance.md +18 -17
- package/docs/api/schema-scene.md +9 -9
- package/docs/api/schema-validation.md +1 -1
- package/docs/api/sensor-accumulated-charge.md +12 -20
- package/docs/api/sensor-architecture.md +15 -16
- package/docs/api/sensor-camera-saturation-capacity.md +9 -11
- package/docs/api/sensor-capture-color-sampling-binding.md +47 -51
- package/docs/api/sensor-capture-mode-timing.md +9 -9
- package/docs/api/sensor-capture-mode.md +29 -30
- package/docs/api/sensor-color-sampling.md +31 -33
- package/docs/api/sensor-constant-rate-temporal-integration.md +10 -11
- package/docs/api/sensor-dark-current.md +30 -14
- package/docs/api/sensor-environment-photo-signal.md +13 -6
- package/docs/api/sensor-eqe-electron-rate.md +9 -8
- package/docs/api/sensor-eqe-local-exposure.md +18 -17
- package/docs/api/sensor-eqe-temporal-exposure.md +12 -11
- package/docs/api/sensor-exposure-window.md +24 -24
- package/docs/api/sensor-fixed-pattern-noise.md +104 -0
- package/docs/api/sensor-iso-gain.md +63 -0
- package/docs/api/sensor-iso-signal-chain.md +13 -22
- package/docs/api/sensor-local-exposure-binding.md +12 -13
- package/docs/api/sensor-optical-stack.md +37 -40
- package/docs/api/sensor-photon-energy.md +10 -11
- package/docs/api/sensor-physical-charge-capacity.md +8 -13
- package/docs/api/sensor-pixel-pitch.md +1 -1
- package/docs/api/sensor-radiometry-readiness.md +9 -9
- package/docs/api/sensor-raw-readout.md +118 -52
- package/docs/api/sensor-raw-reconstruction.md +97 -20
- package/docs/api/sensor-readout-exposure-linkage.md +120 -24
- package/docs/api/sensor-readout-timing.md +33 -35
- package/docs/api/sensor-response-application-compatibility.md +9 -11
- package/docs/api/sensor-response-operating-range.md +14 -18
- package/docs/api/sensor-responsivity-photocurrent.md +9 -12
- package/docs/api/sensor-sampling-aperture.md +22 -25
- package/docs/api/sensor-scene-eqe-temporal-exposure.md +9 -8
- package/docs/api/sensor-sensor-geometry.md +23 -24
- package/docs/api/sensor-signal-noise.md +10 -10
- package/docs/api/sensor-spatial-sample-reduction.md +27 -30
- package/docs/api/sensor-spatial-sampling-quadrature.md +37 -39
- package/docs/api/sensor-spatio-spectral-reduction.md +27 -29
- package/docs/api/sensor-spectral-coverage.md +5 -5
- package/docs/api/sensor-spectral-quadrature.md +33 -35
- package/docs/api/sensor-spectral-response.md +28 -16
- package/docs/api/sensor-temporal-photo-signal.md +6 -6
- package/docs/api/simulation-poc-simulation.md +17 -16
- package/docs/api/stabilization-camera-shake.md +29 -10
- package/docs/api/stabilization-system.md +25 -21
- package/docs/examples/production-request.json +3821 -2157
- package/docs/examples/simulate-capture.mjs +14 -0
- package/llms.txt +35 -0
- package/package.json +32 -12
- package/AGENTS.md +0 -674
- package/CONTRIBUTING.md +0 -76
- package/DCO +0 -33
- package/dist/camera/equivalent-focal-length.d.ts.map +0 -1
- package/dist/camera/field-of-view.d.ts.map +0 -1
- package/dist/camera/projected-object-size.d.ts.map +0 -1
- package/dist/capture/capture-export-metadata.d.ts.map +0 -1
- package/dist/capture/environment-raw-producer.d.ts.map +0 -1
- package/dist/capture/export-jpeg.d.ts.map +0 -1
- package/dist/capture/export-tiff.d.ts.map +0 -1
- package/dist/capture/focus-control.d.ts.map +0 -1
- package/dist/capture/linear-encoding.d.ts.map +0 -1
- package/dist/capture/native-environment-raw.d.ts.map +0 -1
- package/dist/capture/native-raw-development.d.ts.map +0 -1
- package/dist/capture/native-raw.d.ts.map +0 -1
- package/dist/capture/photographic-export.d.ts.map +0 -1
- package/dist/capture/raw-frame-limits.d.ts.map +0 -1
- package/dist/capture/raw-frame-reconstruction.d.ts.map +0 -1
- package/dist/capture/release-sequence.d.ts.map +0 -1
- package/dist/capture/sensor-raw-frame.d.ts.map +0 -1
- package/dist/capture/sensor-raw-producer.d.ts.map +0 -1
- package/dist/capture/simulated-capture.d.ts.map +0 -1
- package/dist/color/capture-color.d.ts.map +0 -1
- package/dist/color/sensor-color-development.d.ts.map +0 -1
- package/dist/color/srgb-icc.d.ts.map +0 -1
- package/dist/color/srgb-transfer.d.ts.map +0 -1
- package/dist/color/white-balance.d.ts.map +0 -1
- package/dist/composition/image-formation-plan.d.ts.map +0 -1
- package/dist/composition/plan-consumer.d.ts.map +0 -1
- package/dist/core/calculation-result.d.ts.map +0 -1
- package/dist/core/canonical-json.d.ts.map +0 -1
- package/dist/core/configuration-error.d.ts.map +0 -1
- package/dist/core/evidence-provenance.d.ts.map +0 -1
- package/dist/core/image-formation.d.ts.map +0 -1
- package/dist/core/owned-data.d.ts.map +0 -1
- package/dist/core/record-validation.d.ts.map +0 -1
- package/dist/core/scientific-assurance.d.ts.map +0 -1
- package/dist/core/spectral-composition.d.ts.map +0 -1
- package/dist/core/spectral.d.ts.map +0 -1
- package/dist/core/validation.d.ts.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/equipment/exposure-capabilities.d.ts.map +0 -1
- package/dist/equipment/generic-tier-assets.d.ts.map +0 -1
- package/dist/equipment/generic-tier-presets.d.ts.map +0 -1
- package/dist/equipment/iso-capabilities.d.ts.map +0 -1
- package/dist/equipment/metering-capabilities.d.ts.map +0 -1
- package/dist/equipment/release-capabilities.d.ts.map +0 -1
- package/dist/exposure/exposure-duration-control.d.ts.map +0 -1
- package/dist/exposure/exposure-mode-resolver.d.ts.map +0 -1
- package/dist/exposure/exposure.d.ts.map +0 -1
- package/dist/exposure/flash.d.ts.map +0 -1
- package/dist/exposure/metering-scene-radiance.d.ts.map +0 -1
- package/dist/exposure/metering-target.d.ts.map +0 -1
- package/dist/exposure/metering-temporal.d.ts.map +0 -1
- package/dist/exposure/metering.d.ts.map +0 -1
- package/dist/exposure/program-line.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/motion/camera-rotation.d.ts.map +0 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts.map +0 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/capture-rotation-trajectory.d.ts.map +0 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/extended-object-projection.d.ts.map +0 -1
- package/dist/motion/projected-motion.d.ts.map +0 -1
- package/dist/optics/aperture.d.ts.map +0 -1
- package/dist/optics/circle-of-confusion.d.ts.map +0 -1
- package/dist/optics/complex-pupil-psf.d.ts.map +0 -1
- package/dist/optics/depth-of-field.d.ts.map +0 -1
- package/dist/optics/diffraction.d.ts.map +0 -1
- package/dist/optics/focus-breathing.d.ts.map +0 -1
- package/dist/optics/focus-state.d.ts.map +0 -1
- package/dist/optics/front-of-lens-filter.d.ts.map +0 -1
- package/dist/optics/illumination-vignetting.d.ts.map +0 -1
- package/dist/optics/lateral-chromatic-aberration.d.ts.map +0 -1
- package/dist/optics/lens-psf-profile.d.ts.map +0 -1
- package/dist/optics/polygon-diffraction.d.ts.map +0 -1
- package/dist/optics/profile-contract.d.ts.map +0 -1
- package/dist/optics/psf-foundation.d.ts.map +0 -1
- package/dist/optics/radial-distortion.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-aperture-rays.d.ts.map +0 -1
- package/dist/optics/sensor-environment-query.d.ts.map +0 -1
- package/dist/optics/sensor-psf-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-psf-support.d.ts.map +0 -1
- package/dist/optics/stray-light.d.ts.map +0 -1
- package/dist/optics/thin-lens.d.ts.map +0 -1
- package/dist/output/capture-corrected-sdr.d.ts.map +0 -1
- package/dist/output/capture-geometry.d.ts.map +0 -1
- package/dist/output/capture-sdr.d.ts.map +0 -1
- package/dist/output/crop.d.ts.map +0 -1
- package/dist/output/geometric-transforms.d.ts.map +0 -1
- package/dist/output/lens-corrections.d.ts.map +0 -1
- package/dist/output/native-capture-sdr.d.ts.map +0 -1
- package/dist/output/print-contrast-reference.d.ts.map +0 -1
- package/dist/output/print-detail.d.ts.map +0 -1
- package/dist/output/print-jpeg.d.ts.map +0 -1
- package/dist/output/print-plan.d.ts.map +0 -1
- package/dist/output/print-region-statistics.d.ts.map +0 -1
- package/dist/output/sdr-rendering.d.ts.map +0 -1
- package/dist/output/subject-framing-crop.d.ts.map +0 -1
- package/dist/schema/camera.d.ts.map +0 -1
- package/dist/schema/camera.js +0 -3
- package/dist/schema/camera.js.map +0 -1
- package/dist/schema/illumination-spectral.d.ts.map +0 -1
- package/dist/schema/illumination-temporal.d.ts.map +0 -1
- package/dist/schema/illumination.d.ts.map +0 -1
- package/dist/schema/scene-radiance-temporal.d.ts.map +0 -1
- package/dist/schema/scene-radiance.d.ts.map +0 -1
- package/dist/schema/scene.d.ts.map +0 -1
- package/dist/schema/scene.js +0 -3
- package/dist/schema/scene.js.map +0 -1
- package/dist/schema/validation.d.ts.map +0 -1
- package/dist/sensor/accumulated-charge.d.ts.map +0 -1
- package/dist/sensor/architecture.d.ts.map +0 -1
- package/dist/sensor/camera-saturation-capacity.d.ts.map +0 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts.map +0 -1
- package/dist/sensor/capture-mode-timing.d.ts.map +0 -1
- package/dist/sensor/capture-mode.d.ts.map +0 -1
- package/dist/sensor/color-sampling.d.ts.map +0 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts.map +0 -1
- package/dist/sensor/dark-current.d.ts.map +0 -1
- package/dist/sensor/environment-photo-signal.d.ts.map +0 -1
- package/dist/sensor/eqe-electron-rate.d.ts.map +0 -1
- package/dist/sensor/eqe-local-exposure.d.ts.map +0 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/exposure-window.d.ts.map +0 -1
- package/dist/sensor/iso-signal-chain.d.ts.map +0 -1
- package/dist/sensor/local-exposure-binding.d.ts.map +0 -1
- package/dist/sensor/optical-stack.d.ts.map +0 -1
- package/dist/sensor/photon-energy.d.ts.map +0 -1
- package/dist/sensor/physical-charge-capacity.d.ts.map +0 -1
- package/dist/sensor/pixel-pitch.d.ts.map +0 -1
- package/dist/sensor/radiometry-readiness.d.ts.map +0 -1
- package/dist/sensor/raw-readout.d.ts.map +0 -1
- package/dist/sensor/raw-reconstruction.d.ts.map +0 -1
- package/dist/sensor/readout-exposure-linkage.d.ts.map +0 -1
- package/dist/sensor/readout-timing.d.ts.map +0 -1
- package/dist/sensor/response-application-compatibility.d.ts.map +0 -1
- package/dist/sensor/response-operating-range.d.ts.map +0 -1
- package/dist/sensor/responsivity-photocurrent.d.ts.map +0 -1
- package/dist/sensor/sampling-aperture.d.ts.map +0 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/sensor-geometry.d.ts.map +0 -1
- package/dist/sensor/signal-noise.d.ts.map +0 -1
- package/dist/sensor/spatial-sample-reduction.d.ts.map +0 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts.map +0 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts.map +0 -1
- package/dist/sensor/spectral-coverage.d.ts.map +0 -1
- package/dist/sensor/spectral-quadrature.d.ts.map +0 -1
- package/dist/sensor/spectral-response.d.ts.map +0 -1
- package/dist/sensor/temporal-eqe-sum.d.ts.map +0 -1
- package/dist/sensor/temporal-photo-signal.d.ts.map +0 -1
- package/dist/sensor/temporal-sample-binding.d.ts.map +0 -1
- package/dist/simulation/poc-simulation.d.ts.map +0 -1
- package/dist/stabilization/camera-shake.d.ts.map +0 -1
- package/dist/stabilization/system.d.ts.map +0 -1
- package/docs/API_STYLE.md +0 -235
- package/docs/ARCHITECTURE.md +0 -356
- package/docs/AUTOMATION_COORDINATION.md +0 -190
- package/docs/CAPTURE_COLOR.md +0 -25
- package/docs/CAPTURE_CORRECTED_SDR.md +0 -25
- package/docs/CAPTURE_EXPORT_METADATA.md +0 -27
- package/docs/CAPTURE_SDR.md +0 -22
- package/docs/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,17 +1,12 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* state
|
|
10
|
-
* Create the initial ideal focus-controller state from an explicit profile, focus plane and public
|
|
11
|
-
* state identity. Focus is a longitudinal plane or explicit infinity state, never a screen-space
|
|
12
|
-
* distance. The ideal actuator resolves supplied target observations; it does not infer a commercial
|
|
13
|
-
* AF sensor, focus-ring scale or acquisition latency. Target loss, reacquisition, focus lock and
|
|
14
|
-
* release priority remain separate state transitions.
|
|
3
|
+
* Focus control: manual focus (MF), single autofocus (AF-S) and continuous autofocus (AF-C), focus
|
|
4
|
+
* lock, and the focus-priority or release-priority check before the shutter fires.
|
|
5
|
+
*
|
|
6
|
+
* Focus is always a distance along the optical axis (a focus plane) or infinity, never a distance
|
|
7
|
+
* on screen. The focus "actuator" is ideal: it focuses on the target observations it is given. It
|
|
8
|
+
* does not model a real AF sensor, a focus-ring scale or how long focusing takes. Losing a target,
|
|
9
|
+
* reacquiring it, locking focus and the release-priority decision are separate state changes.
|
|
15
10
|
* @see docs/SIMULATED_CAPTURE.md for equations, coordinate/unit conventions, blockers and support
|
|
16
11
|
* limits.
|
|
17
12
|
*/
|
|
@@ -19,6 +14,7 @@ import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
|
19
14
|
import { parseEvidenceList } from "../core/evidence-provenance.js";
|
|
20
15
|
import { InvalidScientificInputError } from "../core/validation.js";
|
|
21
16
|
import { parseFocusPlane } from "../optics/focus-state.js";
|
|
17
|
+
import { requireInputObject, requireInputKeys, rejectUnknownFields } from "../core/record-validation.js";
|
|
22
18
|
export const FOCUS_CONTROL_PROFILE_SCHEMA_VERSION = "0.1.0";
|
|
23
19
|
export const FOCUS_CONTROL_STATE_VERSION = "0.1.0";
|
|
24
20
|
const FOCUS_MODES = new Set([
|
|
@@ -37,12 +33,14 @@ const TARGET_LOSS_REASONS = new Set([
|
|
|
37
33
|
"identity-lost",
|
|
38
34
|
"outside-focus-area"
|
|
39
35
|
]);
|
|
40
|
-
function requireRecord(value, path) {
|
|
36
|
+
function requireRecord(value, path, allowedKeys) {
|
|
41
37
|
if (typeof value !== "object" ||
|
|
42
38
|
value === null ||
|
|
43
39
|
Array.isArray(value)) {
|
|
44
40
|
throw new InvalidConfigurationError(path + " must be an object.");
|
|
45
41
|
}
|
|
42
|
+
if (allowedKeys !== null)
|
|
43
|
+
rejectUnknownFields(value, allowedKeys, path);
|
|
46
44
|
return value;
|
|
47
45
|
}
|
|
48
46
|
function requireNonEmptyString(value, path) {
|
|
@@ -56,7 +54,7 @@ function requireNonEmptyString(value, path) {
|
|
|
56
54
|
function requireScientificNonEmptyString(value, path) {
|
|
57
55
|
if (typeof value !== "string" ||
|
|
58
56
|
value.trim().length === 0) {
|
|
59
|
-
throw new
|
|
57
|
+
throw new InvalidConfigurationError(path +
|
|
60
58
|
" must be a non-empty string.");
|
|
61
59
|
}
|
|
62
60
|
return value.trim();
|
|
@@ -119,20 +117,19 @@ function parseUniqueEnumList(value, path, allowed) {
|
|
|
119
117
|
return parsed;
|
|
120
118
|
}
|
|
121
119
|
/**
|
|
122
|
-
*
|
|
123
|
-
* missing required fields and
|
|
120
|
+
* Validates an untrusted focus-control profile and returns it normalized. Unknown enum values,
|
|
121
|
+
* missing required fields and inconsistent scientific data are rejected.
|
|
124
122
|
*
|
|
125
|
-
* Focus is a
|
|
126
|
-
* actuator
|
|
127
|
-
* scale or
|
|
128
|
-
*
|
|
129
|
-
* @
|
|
130
|
-
* @returns FocusControlProfile. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
|
|
123
|
+
* Focus is a distance along the optical axis or infinity, never a distance on screen. The ideal
|
|
124
|
+
* actuator focuses on the target observations it is given. It does not model a real AF sensor, a
|
|
125
|
+
* focus-ring scale or focusing time.
|
|
126
|
+
* @param value - Untrusted data. TypeScript types alone are not validation.
|
|
127
|
+
* @returns The validated profile. Success does not imply calibration.
|
|
131
128
|
*
|
|
132
|
-
* @see docs/API_REFERENCE.md for the
|
|
129
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
133
130
|
*/
|
|
134
131
|
export function parseFocusControlProfile(value) {
|
|
135
|
-
const record = requireRecord(value, "focusControlProfile");
|
|
132
|
+
const record = requireRecord(value, "focusControlProfile", ["schemaVersion", "scientificStatus", "actuator", "continuousTargetLossPolicy", "profileId", "profileVersion", "supportedModes", "supportedReleasePriorities", "evidence", "limitations"]);
|
|
136
133
|
if (record.schemaVersion !==
|
|
137
134
|
FOCUS_CONTROL_PROFILE_SCHEMA_VERSION) {
|
|
138
135
|
throw new InvalidConfigurationError('focusControlProfile.schemaVersion must be "' +
|
|
@@ -143,7 +140,7 @@ export function parseFocusControlProfile(value) {
|
|
|
143
140
|
"approximation") {
|
|
144
141
|
throw new InvalidConfigurationError('focusControlProfile.scientificStatus must be "approximation".');
|
|
145
142
|
}
|
|
146
|
-
const actuator = requireRecord(record.actuator, "focusControlProfile.actuator");
|
|
143
|
+
const actuator = requireRecord(record.actuator, "focusControlProfile.actuator", ["kind", "evidence"]);
|
|
147
144
|
if (actuator.kind !==
|
|
148
145
|
"ideal-instantaneous") {
|
|
149
146
|
throw new InvalidConfigurationError('focusControlProfile.actuator.kind must be "ideal-instantaneous" in schema 0.1.0.');
|
|
@@ -264,19 +261,15 @@ function verifyStateProfile(state, profile) {
|
|
|
264
261
|
}
|
|
265
262
|
}
|
|
266
263
|
/**
|
|
267
|
-
*
|
|
268
|
-
* state
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
* actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
|
|
272
|
-
* scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
|
|
273
|
-
* separate state transitions.
|
|
274
|
-
* @param input - CreateFocusControlStateInput. See the linked contract for coordinate, unit and profile binding semantics.
|
|
275
|
-
* @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
|
|
264
|
+
* Creates the initial ideal focus-controller state from a profile, a focus plane and a public
|
|
265
|
+
* state ID.
|
|
266
|
+
* @param input - New state ID, profile, focus mode, initial focus plane and optional start time.
|
|
267
|
+
* @returns The initial state. Success does not imply calibration.
|
|
276
268
|
*
|
|
277
|
-
* @see docs/API_REFERENCE.md for the
|
|
269
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
278
270
|
*/
|
|
279
271
|
export function createFocusControlState(input) {
|
|
272
|
+
requireInputKeys(input, "createFocusControlState", ["stateId", "profile", "mode", "initialFocus", "initialTimeSeconds"]);
|
|
280
273
|
const profile = parseFocusControlProfile(input.profile);
|
|
281
274
|
requireSupportedMode(profile, input.mode);
|
|
282
275
|
const time = input.initialTimeSeconds ===
|
|
@@ -312,19 +305,16 @@ function stateProfileView(state) {
|
|
|
312
305
|
};
|
|
313
306
|
}
|
|
314
307
|
/**
|
|
315
|
-
*
|
|
316
|
-
* actuator or focus-ring conversion.
|
|
308
|
+
* Returns the state after manually focusing on the given finite or infinity plane. No lens
|
|
309
|
+
* actuator or focus-ring conversion is modelled.
|
|
310
|
+
* @param input - Current state, new state ID, new focus plane and event time.
|
|
311
|
+
* @returns The new state. Success does not imply calibration.
|
|
317
312
|
*
|
|
318
|
-
*
|
|
319
|
-
* actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
|
|
320
|
-
* scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
|
|
321
|
-
* separate state transitions.
|
|
322
|
-
* @param input - SetManualFocusStateInput. See the linked contract for coordinate, unit and profile binding semantics.
|
|
323
|
-
* @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
|
|
324
|
-
*
|
|
325
|
-
* @see docs/API_REFERENCE.md for the root export and exact type graph.
|
|
313
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
326
314
|
*/
|
|
327
315
|
export function setManualFocusState(input) {
|
|
316
|
+
requireInputKeys(input, "setManualFocusState", ["state", "stateId", "focus", "eventTimeSeconds", "commandId"]);
|
|
317
|
+
requireInputObject(input.state, "state");
|
|
328
318
|
if (input.state.mode !==
|
|
329
319
|
"manual") {
|
|
330
320
|
throw new InvalidScientificInputError("setManualFocusState requires manual focus mode.");
|
|
@@ -393,7 +383,7 @@ function parseObservation(observation) {
|
|
|
393
383
|
reason: observation.reason
|
|
394
384
|
};
|
|
395
385
|
}
|
|
396
|
-
throw new
|
|
386
|
+
throw new InvalidConfigurationError("observation.kind/reason is invalid.");
|
|
397
387
|
}
|
|
398
388
|
function focusFromObservation(observation) {
|
|
399
389
|
if (observation.kind ===
|
|
@@ -444,22 +434,21 @@ function unchangedResolution(input) {
|
|
|
444
434
|
};
|
|
445
435
|
}
|
|
446
436
|
/**
|
|
447
|
-
*
|
|
448
|
-
* policy,
|
|
437
|
+
* Applies one target observation (target available or lost) under the selected AF-S or AF-C
|
|
438
|
+
* policy, and records whether the target was acquired or reacquired.
|
|
449
439
|
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* @param input - ResolveFocusTargetObservationInput. See the linked contract for coordinate, unit and profile binding semantics.
|
|
455
|
-
* @returns FocusTargetResolution. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
|
|
440
|
+
* The ideal actuator focuses on the observation as given. Target loss, reacquisition, focus
|
|
441
|
+
* lock and release priority are separate state changes.
|
|
442
|
+
* @param input - Current state, new state ID, control event and target observation.
|
|
443
|
+
* @returns The resolution and new state. Success does not imply calibration.
|
|
456
444
|
*
|
|
457
|
-
* @see docs/API_REFERENCE.md for the
|
|
445
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
458
446
|
*/
|
|
459
447
|
export function resolveFocusTargetObservation(input) {
|
|
448
|
+
requireInputKeys(input, "resolveFocusTargetObservation", ["state", "stateId", "event", "observation"]);
|
|
460
449
|
if (input.event !== "acquire" &&
|
|
461
450
|
input.event !== "update") {
|
|
462
|
-
throw new
|
|
451
|
+
throw new InvalidConfigurationError('Focus target event must be "acquire" or "update".');
|
|
463
452
|
}
|
|
464
453
|
if (input.state.mode ===
|
|
465
454
|
"manual") {
|
|
@@ -535,18 +524,14 @@ export function resolveFocusTargetObservation(input) {
|
|
|
535
524
|
return stateFromResolvedTarget(input, observation);
|
|
536
525
|
}
|
|
537
526
|
/**
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
* actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
|
|
542
|
-
* scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
|
|
543
|
-
* separate state transitions.
|
|
544
|
-
* @param input - SetFocusLockInput. See the linked contract for coordinate, unit and profile binding semantics.
|
|
545
|
-
* @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
|
|
527
|
+
* Locks or unlocks focus. The physical focus plane does not change.
|
|
528
|
+
* @param input - Current state, new state ID, lock setting and event time.
|
|
529
|
+
* @returns The new state. Success does not imply calibration.
|
|
546
530
|
*
|
|
547
|
-
* @see docs/API_REFERENCE.md for the
|
|
531
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
548
532
|
*/
|
|
549
533
|
export function setFocusLock(input) {
|
|
534
|
+
requireInputKeys(input, "setFocusLock", ["state", "stateId", "locked", "eventTimeSeconds"]);
|
|
550
535
|
const time = requireMonotonicEventTime(input.state, input.eventTimeSeconds);
|
|
551
536
|
if (input.locked) {
|
|
552
537
|
if (input.state.locked) {
|
|
@@ -575,19 +560,15 @@ export function setFocusLock(input) {
|
|
|
575
560
|
.activeFocusAreaId);
|
|
576
561
|
}
|
|
577
562
|
/**
|
|
578
|
-
*
|
|
579
|
-
* operate
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
* actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
|
|
583
|
-
* scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
|
|
584
|
-
* separate state transitions.
|
|
585
|
-
* @param input - AssessFocusReleaseGateInput. See the linked contract for coordinate, unit and profile binding semantics.
|
|
586
|
-
* @returns FocusReleaseGateAssessment. Read structured blockers before consuming an authorization.
|
|
563
|
+
* Reports whether the shutter may be released under the focus-priority or release-priority
|
|
564
|
+
* policy. It does not operate the shutter.
|
|
565
|
+
* @param input - Current state, profile and release priority.
|
|
566
|
+
* @returns The assessment. Read its structured blockers before acting on an authorization.
|
|
587
567
|
*
|
|
588
|
-
* @see docs/API_REFERENCE.md for the
|
|
568
|
+
* @see docs/API_REFERENCE.md for the package export and its full type definitions.
|
|
589
569
|
*/
|
|
590
570
|
export function assessFocusReleaseGate(input) {
|
|
571
|
+
requireInputKeys(input, "assessFocusReleaseGate", ["state", "profile", "priority"]);
|
|
591
572
|
const profile = parseFocusControlProfile(input.profile);
|
|
592
573
|
verifyStateProfile(input.state, profile);
|
|
593
574
|
if (!profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-control.js","sourceRoot":"","sources":["../../src/capture/focus-control.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,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C/B,qCAAqC,EACnC,IAAI;YACN,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,IACE,KAAK,CAAC,KAAK,CAAC,IAAI;QAChB,QAAQ,EACR,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,oBAAoB;YACtB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,IACE,KAAK,CAAC,KAAK;SACR,gBAAgB;QACnB,QAAQ,EACR,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,cAAc;YAChB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,IACE,KAAK,CAAC,KAAK;SACR,gBAAgB;QACnB,UAAU,EACV,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,gBAAgB;YAClB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EACN,KAAK,CAAC,QAAQ;QAChB,iBAAiB,EAAE,KAAK;QACxB,MAAM,EACJ,oBAAoB;QACtB,qCAAqC,EACnC,KAAK;QACP,oBAAoB,EAClB,KAAK;QACP,gBAAgB,EACd,KAAK;KACR,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"focus-control.js","sourceRoot":"","sources":["../../src/capture/focus-control.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,yBAAyB,EA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AED,IACE,KAAK,CAAC,KAAK,CAAC,IAAI;QAChB,QAAQ,EACR,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,oBAAoB;YACtB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,IACE,KAAK,CAAC,KAAK;SACR,gBAAgB;QACnB,QAAQ,EACR,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,cAAc;YAChB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,IACE,KAAK,CAAC,KAAK;SACR,gBAAgB;QACnB,UAAU,EACV,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,gBAAgB;YAClB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EACN,KAAK,CAAC,QAAQ;QAChB,iBAAiB,EAAE,KAAK;QACxB,MAAM,EACJ,oBAAoB;QACtB,qCAAqC,EACnC,KAAK;QACP,oBAAoB,EAClB,KAAK;QACP,gBAAgB,EACd,KAAK;KACR,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Focus control: manual focus (MF), single autofocus (AF-S) and continuous autofocus (AF-C), focus\n * lock, and the focus-priority or release-priority check before the shutter fires.\n *\n * Focus is always a distance along the optical axis (a focus plane) or infinity, never a distance\n * on screen. The focus \"actuator\" is ideal: it focuses on the target observations it is given. It\n * does not model a real AF sensor, a focus-ring scale or how long focusing takes. Losing a target,\n * reacquiring it, locking focus and the release-priority decision are separate state changes.\n * @see docs/SIMULATED_CAPTURE.md for equations, coordinate/unit conventions, blockers and support\n * limits.\n */\n\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\nimport {\n parseEvidenceList,\n type EvidenceProvenance\n} from \"../core/evidence-provenance.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport {\n parseFocusPlane,\n type FocusPlane\n} from \"../optics/focus-state.js\";\nimport { requireInputObject, requireInputKeys, rejectUnknownFields } from \"../core/record-validation.js\";\n\ntype UnknownRecord = Record<string, unknown>;\n\nexport const FOCUS_CONTROL_PROFILE_SCHEMA_VERSION =\n \"0.1.0\" as const;\nexport const FOCUS_CONTROL_STATE_VERSION =\n \"0.1.0\" as const;\n\nexport type FocusControlMode =\n | \"manual\"\n | \"single-af\"\n | \"continuous-af\";\n\nexport type FocusAcquisitionState =\n | \"idle\"\n | \"acquiring\"\n | \"acquired\"\n | \"target-lost\"\n | \"locked\";\n\nexport type FocusReleasePriority =\n | \"focus-priority\"\n | \"release-priority\"\n | \"balanced\";\n\nexport type FocusTargetLossReason =\n | \"occluded\"\n | \"out-of-frame\"\n | \"identity-lost\"\n | \"outside-focus-area\";\n\nexport interface FocusControlProfile {\n schemaVersion:\n typeof FOCUS_CONTROL_PROFILE_SCHEMA_VERSION;\n profileId: string;\n profileVersion: string;\n scientificStatus: \"approximation\";\n supportedModes:\n readonly FocusControlMode[];\n actuator: {\n kind: \"ideal-instantaneous\";\n evidence:\n readonly EvidenceProvenance[];\n };\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\";\n supportedReleasePriorities:\n readonly FocusReleasePriority[];\n evidence:\n readonly EvidenceProvenance[];\n limitations: readonly string[];\n}\n\ninterface FocusTargetObservationBase {\n targetId: string;\n focusAreaId?: string;\n observedAtSeconds: number;\n}\n\nexport type FocusTargetObservation =\n | (FocusTargetObservationBase & {\n kind: \"finite-surface\";\n /**\n * Distance along the camera's optical axis (the same convention as\n * FocusPlane), not the renderer's ray length to the point.\n */\n longitudinalDistanceM: number;\n })\n | (FocusTargetObservationBase & {\n kind:\n \"infinity-environment\";\n })\n | (FocusTargetObservationBase & {\n kind: \"unavailable\";\n reason:\n FocusTargetLossReason;\n });\n\n/**\n * Immutable focus-controller state for MF, AF-S or AF-C.\n *\n * The resolved focus is a finite distance along the optical axis in metres, or infinity.\n * Acquisition, loss, reacquisition and lock records explain why a target can be used. The\n * focus-release check is separate from shutter sequencing. The ideal actuator does not model\n * real AF accuracy or the physical time focusing takes.\n */\nexport interface FocusControlState {\n version:\n typeof FOCUS_CONTROL_STATE_VERSION;\n stateId: string;\n sourceProfile: {\n profileId: string;\n profileVersion: string;\n };\n profileLimitations:\n readonly string[];\n mode:\n FocusControlMode;\n acquisitionState:\n FocusAcquisitionState;\n focus:\n FocusPlane;\n activeTargetId?: string;\n activeFocusAreaId?: string;\n lastEventTimeSeconds: number;\n focusResolvedAtSeconds:\n number;\n locked: boolean;\n lock?: {\n lockedAtSeconds: number;\n resumeAcquisitionState:\n Exclude<\n FocusAcquisitionState,\n \"locked\"\n >;\n };\n actuatorModel:\n \"ideal-instantaneous\";\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\";\n exposureModified: false;\n meteringModified: false;\n whiteBalanceModified: false;\n subjectTrackingRecognitionModeled:\n false;\n rendererCoordinatesConsumed:\n false;\n limitations:\n readonly string[];\n}\n\nexport interface CreateFocusControlStateInput {\n stateId: string;\n profile:\n FocusControlProfile;\n mode:\n FocusControlMode;\n initialFocus:\n FocusPlane;\n initialTimeSeconds?: number;\n}\n\nexport interface SetManualFocusStateInput {\n state:\n FocusControlState;\n stateId: string;\n focus:\n FocusPlane;\n eventTimeSeconds: number;\n commandId?: string;\n}\n\nexport type FocusTargetControlEvent =\n | \"acquire\"\n | \"update\";\n\nexport interface ResolveFocusTargetObservationInput {\n state:\n FocusControlState;\n stateId: string;\n event:\n FocusTargetControlEvent;\n observation:\n FocusTargetObservation;\n}\n\nexport interface FocusTargetResolution {\n state:\n FocusControlState;\n targetObservationApplied:\n boolean;\n focusChanged: boolean;\n acquisitionEvent:\n FocusTargetControlEvent;\n actuatorModel:\n \"ideal-instantaneous\";\n silentRetargetingPerformed:\n false;\n}\n\nexport interface SetFocusLockInput {\n state:\n FocusControlState;\n stateId: string;\n locked: boolean;\n eventTimeSeconds: number;\n}\n\nexport interface AssessFocusReleaseGateInput {\n state:\n FocusControlState;\n profile:\n FocusControlProfile;\n priority:\n FocusReleasePriority;\n}\n\nexport interface FocusReleaseGateAssessment {\n priority:\n FocusReleasePriority;\n releaseAuthorized: boolean;\n reason:\n | \"manual-focus-state\"\n | \"focus-acquired\"\n | \"focus-locked\"\n | \"release-priority-bypasses-focus-gate\"\n | \"focus-not-acquired\"\n | \"balanced-policy-not-modeled\";\n requiresProfileSpecificBalancedPolicy:\n boolean;\n opticalFocusModified: false;\n exposureModified: false;\n}\n\nconst FOCUS_MODES =\n new Set<FocusControlMode>([\n \"manual\",\n \"single-af\",\n \"continuous-af\"\n ]);\n\nconst RELEASE_PRIORITIES =\n new Set<FocusReleasePriority>([\n \"focus-priority\",\n \"release-priority\",\n \"balanced\"\n ]);\n\nconst TARGET_LOSS_REASONS =\n new Set<FocusTargetLossReason>([\n \"occluded\",\n \"out-of-frame\",\n \"identity-lost\",\n \"outside-focus-area\"\n ]);\n\nfunction requireRecord(\n value: unknown,\n path: string,\n allowedKeys: readonly string[] | null\n): UnknownRecord {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value)\n ) {\n throw new InvalidConfigurationError(\n path + \" must be an object.\"\n );\n }\n if (allowedKeys !== null) rejectUnknownFields(value, allowedKeys, path);\n return value as UnknownRecord;\n}\n\nfunction requireNonEmptyString(\n value: unknown,\n path: string\n): string {\n if (\n typeof value !== \"string\" ||\n value.trim().length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty string.\"\n );\n }\n return value.trim();\n}\n\nfunction requireScientificNonEmptyString(\n value: string,\n path: string\n): string {\n if (\n typeof value !== \"string\" ||\n value.trim().length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty string.\"\n );\n }\n return value.trim();\n}\n\nfunction requireScientificNonNegativeFinite(\n value: number,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value < 0\n ) {\n throw new InvalidScientificInputError(\n path +\n \" must be finite and greater than or equal to zero.\"\n );\n }\n return value;\n}\n\nfunction requireScientificPositiveFinite(\n value: number,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value <= 0\n ) {\n throw new InvalidScientificInputError(\n path +\n \" must be finite and greater than zero.\"\n );\n }\n return value;\n}\n\nfunction parseLimitations(\n value: unknown,\n path: string\n): readonly string[] {\n if (!Array.isArray(value)) {\n throw new InvalidConfigurationError(\n path + \" must be an array.\"\n );\n }\n const parsed =\n value.map((entry, index) =>\n requireNonEmptyString(\n entry,\n path +\n \"[\" +\n index +\n \"]\"\n )\n );\n if (\n new Set(parsed).size !==\n parsed.length\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must not contain duplicates.\"\n );\n }\n return parsed;\n}\n\nfunction parseUniqueEnumList<T extends string>(\n value: unknown,\n path: string,\n allowed: ReadonlySet<T>\n): readonly T[] {\n if (\n !Array.isArray(value) ||\n value.length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty array.\"\n );\n }\n const parsed =\n value.map((entry, index) => {\n if (\n typeof entry !==\n \"string\" ||\n !allowed.has(entry as T)\n ) {\n throw new InvalidConfigurationError(\n path +\n \"[\" +\n index +\n \"] is invalid.\"\n );\n }\n return entry as T;\n });\n if (\n new Set(parsed).size !==\n parsed.length\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must not contain duplicates.\"\n );\n }\n return parsed;\n}\n\n/**\n * Validates an untrusted focus-control profile and returns it normalized. Unknown enum values,\n * missing required fields and inconsistent scientific data are rejected.\n *\n * Focus is a distance along the optical axis or infinity, never a distance on screen. The ideal\n * actuator focuses on the target observations it is given. It does not model a real AF sensor, a\n * focus-ring scale or focusing time.\n * @param value - Untrusted data. TypeScript types alone are not validation.\n * @returns The validated profile. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function parseFocusControlProfile(\n value: unknown\n): FocusControlProfile {\n const record =\n requireRecord(\n value,\n \"focusControlProfile\", [\"schemaVersion\", \"scientificStatus\", \"actuator\", \"continuousTargetLossPolicy\", \"profileId\", \"profileVersion\", \"supportedModes\", \"supportedReleasePriorities\", \"evidence\", \"limitations\"]\n );\n\n if (\n record.schemaVersion !==\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.schemaVersion must be \"' +\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION +\n '\".'\n );\n }\n if (\n record.scientificStatus !==\n \"approximation\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.scientificStatus must be \"approximation\".'\n );\n }\n\n const actuator =\n requireRecord(\n record.actuator,\n \"focusControlProfile.actuator\", [\"kind\", \"evidence\"]\n );\n if (\n actuator.kind !==\n \"ideal-instantaneous\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.actuator.kind must be \"ideal-instantaneous\" in schema 0.1.0.'\n );\n }\n if (\n record\n .continuousTargetLossPolicy !==\n \"hold-last-focus-require-explicit-reacquisition\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.continuousTargetLossPolicy must be \"hold-last-focus-require-explicit-reacquisition\".'\n );\n }\n\n return {\n schemaVersion:\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION,\n profileId:\n requireNonEmptyString(\n record.profileId,\n \"focusControlProfile.profileId\"\n ),\n profileVersion:\n requireNonEmptyString(\n record.profileVersion,\n \"focusControlProfile.profileVersion\"\n ),\n scientificStatus:\n \"approximation\",\n supportedModes:\n parseUniqueEnumList(\n record.supportedModes,\n \"focusControlProfile.supportedModes\",\n FOCUS_MODES\n ),\n actuator: {\n kind:\n \"ideal-instantaneous\",\n evidence:\n parseEvidenceList(\n actuator.evidence,\n \"focusControlProfile.actuator.evidence\"\n )\n },\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\",\n supportedReleasePriorities:\n parseUniqueEnumList(\n record\n .supportedReleasePriorities,\n \"focusControlProfile.supportedReleasePriorities\",\n RELEASE_PRIORITIES\n ),\n evidence:\n parseEvidenceList(\n record.evidence,\n \"focusControlProfile.evidence\"\n ),\n limitations:\n parseLimitations(\n record.limitations,\n \"focusControlProfile.limitations\"\n )\n };\n}\n\nfunction cloneJson<T>(\n value: T\n): T {\n return JSON.parse(\n JSON.stringify(value)\n ) as T;\n}\n\nfunction deepFreeze<T>(\n value: T\n): T {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.isFrozen(value)\n ) {\n return value;\n }\n\n Object.freeze(value);\n for (\n const child of\n Object.values(\n value as UnknownRecord\n )\n ) {\n deepFreeze(child);\n }\n return value;\n}\n\nfunction immutableState(\n state:\n FocusControlState\n): FocusControlState {\n return deepFreeze(\n cloneJson(state)\n );\n}\n\nfunction stateBase(\n stateId: string,\n profile:\n FocusControlProfile,\n mode:\n FocusControlMode,\n focus:\n FocusPlane,\n acquisitionState:\n FocusAcquisitionState,\n eventTimeSeconds: number,\n focusResolvedAtSeconds:\n number,\n activeTargetId?:\n string,\n activeFocusAreaId?:\n string,\n lock?:\n FocusControlState[\"lock\"]\n): FocusControlState {\n return immutableState({\n version:\n FOCUS_CONTROL_STATE_VERSION,\n stateId:\n requireScientificNonEmptyString(\n stateId,\n \"stateId\"\n ),\n sourceProfile: {\n profileId:\n profile.profileId,\n profileVersion:\n profile.profileVersion\n },\n profileLimitations: [\n ...profile.limitations\n ],\n mode,\n acquisitionState,\n focus:\n parseFocusPlane(focus),\n ...(activeTargetId ===\n undefined\n ? {}\n : {\n activeTargetId\n }),\n ...(activeFocusAreaId ===\n undefined\n ? {}\n : {\n activeFocusAreaId\n }),\n lastEventTimeSeconds:\n eventTimeSeconds,\n focusResolvedAtSeconds,\n locked:\n acquisitionState ===\n \"locked\",\n ...(lock === undefined\n ? {}\n : {\n lock\n }),\n actuatorModel:\n \"ideal-instantaneous\",\n continuousTargetLossPolicy:\n profile\n .continuousTargetLossPolicy,\n exposureModified: false,\n meteringModified: false,\n whiteBalanceModified:\n false,\n subjectTrackingRecognitionModeled:\n false,\n rendererCoordinatesConsumed:\n false,\n limitations: [\n ...profile.limitations,\n \"Focus target observations use longitudinal camera-space/conjugate distance, not renderer ray length.\",\n \"Ideal instantaneous focus actuation is an approximation and does not represent commercial AF speed, error, hunting, recognition, or low-light behavior.\",\n \"Focus control does not modify exposure, metering, white balance, or scene illumination.\"\n ]\n });\n}\n\nfunction requireSupportedMode(\n profile:\n FocusControlProfile,\n mode:\n FocusControlMode\n): void {\n if (\n !profile.supportedModes\n .includes(mode)\n ) {\n throw new InvalidScientificInputError(\n \"Selected focus-control mode is not supported by the profile.\"\n );\n }\n}\n\nfunction requireMonotonicEventTime(\n current:\n FocusControlState,\n eventTimeSeconds: number\n): number {\n const parsed =\n requireScientificNonNegativeFinite(\n eventTimeSeconds,\n \"eventTimeSeconds\"\n );\n if (\n parsed <\n current.lastEventTimeSeconds\n ) {\n throw new InvalidScientificInputError(\n \"Focus-control event time must not move backward.\"\n );\n }\n return parsed;\n}\n\nfunction verifyStateProfile(\n state:\n FocusControlState,\n profile:\n FocusControlProfile\n): void {\n if (\n state.sourceProfile\n .profileId !==\n profile.profileId ||\n state.sourceProfile\n .profileVersion !==\n profile.profileVersion\n ) {\n throw new InvalidScientificInputError(\n \"Focus-control state/profile identity does not match.\"\n );\n }\n}\n\n/**\n * Creates the initial ideal focus-controller state from a profile, a focus plane and a public\n * state ID.\n * @param input - New state ID, profile, focus mode, initial focus plane and optional start time.\n * @returns The initial state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function createFocusControlState(\n input:\n CreateFocusControlStateInput\n): FocusControlState {\n requireInputKeys(input, \"createFocusControlState\", [\"stateId\", \"profile\", \"mode\", \"initialFocus\", \"initialTimeSeconds\"]);\n const profile =\n parseFocusControlProfile(\n input.profile\n );\n requireSupportedMode(\n profile,\n input.mode\n );\n const time =\n input.initialTimeSeconds ===\n undefined\n ? 0\n : requireScientificNonNegativeFinite(\n input.initialTimeSeconds,\n \"initialTimeSeconds\"\n );\n\n return stateBase(\n input.stateId,\n profile,\n input.mode,\n input.initialFocus,\n \"idle\",\n time,\n time\n );\n}\n\nfunction stateProfileView(\n state:\n FocusControlState\n): FocusControlProfile {\n return {\n schemaVersion:\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION,\n profileId:\n state.sourceProfile\n .profileId,\n profileVersion:\n state.sourceProfile\n .profileVersion,\n scientificStatus:\n \"approximation\",\n supportedModes: [\n state.mode\n ],\n actuator: {\n kind:\n \"ideal-instantaneous\",\n evidence: []\n },\n continuousTargetLossPolicy:\n state\n .continuousTargetLossPolicy,\n supportedReleasePriorities: [\n \"focus-priority\",\n \"release-priority\",\n \"balanced\"\n ],\n evidence: [],\n limitations:\n state.profileLimitations\n };\n}\n\n/**\n * Returns the state after manually focusing on the given finite or infinity plane. No lens\n * actuator or focus-ring conversion is modelled.\n * @param input - Current state, new state ID, new focus plane and event time.\n * @returns The new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function setManualFocusState(\n input:\n SetManualFocusStateInput\n): FocusControlState {\n requireInputKeys(input, \"setManualFocusState\", [\"state\", \"stateId\", \"focus\", \"eventTimeSeconds\", \"commandId\"]);\n requireInputObject(input.state, \"state\");\n if (\n input.state.mode !==\n \"manual\"\n ) {\n throw new InvalidScientificInputError(\n \"setManualFocusState requires manual focus mode.\"\n );\n }\n if (input.state.locked) {\n throw new InvalidScientificInputError(\n \"Manual focus cannot change while focus lock is active.\"\n );\n }\n if (\n input.commandId !==\n undefined\n ) {\n requireScientificNonEmptyString(\n input.commandId,\n \"commandId\"\n );\n }\n const time =\n requireMonotonicEventTime(\n input.state,\n input.eventTimeSeconds\n );\n\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"manual\",\n input.focus,\n \"idle\",\n time,\n time\n );\n}\n\nfunction parseObservation(\n observation:\n FocusTargetObservation\n): FocusTargetObservation {\n const targetId =\n requireScientificNonEmptyString(\n observation.targetId,\n \"observation.targetId\"\n );\n const observedAtSeconds =\n requireScientificNonNegativeFinite(\n observation\n .observedAtSeconds,\n \"observation.observedAtSeconds\"\n );\n const focusAreaId =\n observation.focusAreaId ===\n undefined\n ? undefined\n : requireScientificNonEmptyString(\n observation.focusAreaId,\n \"observation.focusAreaId\"\n );\n\n if (\n observation.kind ===\n \"finite-surface\"\n ) {\n return {\n kind: \"finite-surface\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds,\n longitudinalDistanceM:\n requireScientificPositiveFinite(\n observation\n .longitudinalDistanceM,\n \"observation.longitudinalDistanceM\"\n )\n };\n }\n\n if (\n observation.kind ===\n \"infinity-environment\"\n ) {\n return {\n kind:\n \"infinity-environment\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds\n };\n }\n\n if (\n observation.kind ===\n \"unavailable\" &&\n TARGET_LOSS_REASONS.has(\n observation.reason\n )\n ) {\n return {\n kind: \"unavailable\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds,\n reason:\n observation.reason\n };\n }\n\n throw new InvalidConfigurationError(\n \"observation.kind/reason is invalid.\"\n );\n}\n\nfunction focusFromObservation(\n observation:\n Exclude<\n FocusTargetObservation,\n {\n kind: \"unavailable\";\n }\n >\n): FocusPlane {\n if (\n observation.kind ===\n \"infinity-environment\"\n ) {\n return {\n kind: \"infinity\"\n };\n }\n return {\n kind: \"finite\",\n distanceM:\n observation\n .longitudinalDistanceM\n };\n}\n\nfunction focusEquals(\n a: FocusPlane,\n b: FocusPlane\n): boolean {\n if (\n a.kind !== b.kind\n ) {\n return false;\n }\n if (\n a.kind === \"infinity\" ||\n b.kind === \"infinity\"\n ) {\n return true;\n }\n return (\n a.distanceM ===\n b.distanceM\n );\n}\n\nfunction stateFromResolvedTarget(\n input:\n ResolveFocusTargetObservationInput,\n observation:\n Exclude<\n FocusTargetObservation,\n {\n kind: \"unavailable\";\n }\n >\n): FocusTargetResolution {\n const focus =\n focusFromObservation(\n observation\n );\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n focus,\n \"acquired\",\n observation\n .observedAtSeconds,\n observation\n .observedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged:\n !focusEquals(\n input.state.focus,\n focus\n ),\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n}\n\nfunction unchangedResolution(\n input:\n ResolveFocusTargetObservationInput\n): FocusTargetResolution {\n return {\n state: input.state,\n targetObservationApplied:\n false,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n}\n\n/**\n * Applies one target observation (target available or lost) under the selected AF-S or AF-C\n * policy, and records whether the target was acquired or reacquired.\n *\n * The ideal actuator focuses on the observation as given. Target loss, reacquisition, focus\n * lock and release priority are separate state changes.\n * @param input - Current state, new state ID, control event and target observation.\n * @returns The resolution and new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function resolveFocusTargetObservation(\n input:\n ResolveFocusTargetObservationInput\n): FocusTargetResolution {\n requireInputKeys(input, \"resolveFocusTargetObservation\", [\"state\", \"stateId\", \"event\", \"observation\"]);\n if (\n input.event !== \"acquire\" &&\n input.event !== \"update\"\n ) {\n throw new InvalidConfigurationError(\n 'Focus target event must be \"acquire\" or \"update\".'\n );\n }\n if (\n input.state.mode ===\n \"manual\"\n ) {\n throw new InvalidScientificInputError(\n \"Manual focus does not automatically consume autofocus target observations.\"\n );\n }\n\n const observation =\n parseObservation(\n input.observation\n );\n requireMonotonicEventTime(\n input.state,\n observation\n .observedAtSeconds\n );\n\n if (input.state.locked) {\n return unchangedResolution(\n input\n );\n }\n\n if (\n input.state.mode ===\n \"single-af\"\n ) {\n if (\n input.event ===\n \"update\" &&\n input.state\n .acquisitionState ===\n \"acquired\"\n ) {\n return unchangedResolution(\n input\n );\n }\n if (\n input.event !==\n \"acquire\"\n ) {\n throw new InvalidScientificInputError(\n \"Single AF requires an explicit acquire event before target updates.\"\n );\n }\n if (\n observation.kind ===\n \"unavailable\"\n ) {\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"single-af\",\n input.state.focus,\n \"target-lost\",\n observation\n .observedAtSeconds,\n input.state\n .focusResolvedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n }\n return stateFromResolvedTarget(\n input,\n observation\n );\n }\n\n if (\n input.event ===\n \"update\"\n ) {\n if (\n input.state\n .activeTargetId ===\n undefined\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF requires an explicit acquire event before updates.\"\n );\n }\n if (\n observation.targetId !==\n input.state\n .activeTargetId\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF update targetId must match the active target; silent retargeting is not permitted.\"\n );\n }\n if (\n input.state\n .acquisitionState ===\n \"target-lost\"\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF target loss requires an explicit acquire event before reacquisition.\"\n );\n }\n }\n\n if (\n observation.kind ===\n \"unavailable\"\n ) {\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"continuous-af\",\n input.state.focus,\n \"target-lost\",\n observation\n .observedAtSeconds,\n input.state\n .focusResolvedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n }\n\n return stateFromResolvedTarget(\n input,\n observation\n );\n}\n\n/**\n * Locks or unlocks focus. The physical focus plane does not change.\n * @param input - Current state, new state ID, lock setting and event time.\n * @returns The new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function setFocusLock(\n input:\n SetFocusLockInput\n): FocusControlState {\n requireInputKeys(input, \"setFocusLock\", [\"state\", \"stateId\", \"locked\", \"eventTimeSeconds\"]);\n const time =\n requireMonotonicEventTime(\n input.state,\n input.eventTimeSeconds\n );\n\n if (input.locked) {\n if (input.state.locked) {\n return input.state;\n }\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n input.state.focus,\n \"locked\",\n time,\n input.state\n .focusResolvedAtSeconds,\n input.state\n .activeTargetId,\n input.state\n .activeFocusAreaId,\n {\n lockedAtSeconds:\n time,\n resumeAcquisitionState:\n input.state\n .acquisitionState as Exclude<\n FocusAcquisitionState,\n \"locked\"\n >\n }\n );\n }\n\n if (!input.state.locked) {\n return input.state;\n }\n const resume =\n input.state.lock\n ?.resumeAcquisitionState;\n if (resume === undefined) {\n throw new InvalidScientificInputError(\n \"Locked focus state is missing its resume acquisition state.\"\n );\n }\n\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n input.state.focus,\n resume,\n time,\n input.state\n .focusResolvedAtSeconds,\n input.state\n .activeTargetId,\n input.state\n .activeFocusAreaId\n );\n}\n\n/**\n * Reports whether the shutter may be released under the focus-priority or release-priority\n * policy. It does not operate the shutter.\n * @param input - Current state, profile and release priority.\n * @returns The assessment. Read its structured blockers before acting on an authorization.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function assessFocusReleaseGate(\n input:\n AssessFocusReleaseGateInput\n): FocusReleaseGateAssessment {\n requireInputKeys(input, \"assessFocusReleaseGate\", [\"state\", \"profile\", \"priority\"]);\n const profile =\n parseFocusControlProfile(\n input.profile\n );\n verifyStateProfile(\n input.state,\n profile\n );\n\n if (\n !profile\n .supportedReleasePriorities\n .includes(\n input.priority\n )\n ) {\n throw new InvalidScientificInputError(\n \"Selected focus/release priority is not supported by the profile.\"\n );\n }\n\n if (\n input.priority ===\n \"release-priority\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"release-priority-bypasses-focus-gate\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.priority ===\n \"balanced\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized:\n false,\n reason:\n \"balanced-policy-not-modeled\",\n requiresProfileSpecificBalancedPolicy:\n true,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state.mode ===\n \"manual\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"manual-focus-state\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state\n .acquisitionState ===\n \"locked\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"focus-locked\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state\n .acquisitionState ===\n \"acquired\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"focus-acquired\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n return {\n priority:\n input.priority,\n releaseAuthorized: false,\n reason:\n \"focus-not-acquired\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal: decides how often native tile loops yield to the host (browser) event loop.
|
|
3
|
+
*
|
|
4
|
+
* Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`
|
|
5
|
+
* callback is awaited only once the work since the last yield reaches a time budget, and always
|
|
6
|
+
* after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA
|
|
7
|
+
* (colour filter array) and noise-seed indexing, and every output value are unaffected.
|
|
8
|
+
* Not exported from the package.
|
|
9
|
+
*/
|
|
10
|
+
/** Default work budget between host yields: about half of a 60 Hz frame. */
|
|
11
|
+
export declare const HOST_YIELD_BUDGET_MILLISECONDS = 8;
|
|
12
|
+
export interface HostYieldCadence {
|
|
13
|
+
/** Yield once at least this many milliseconds (monotonic clock) have passed since the last yield. 0 yields after every tile. */
|
|
14
|
+
readonly budgetMilliseconds: number;
|
|
15
|
+
/** Monotonic clock in milliseconds. */
|
|
16
|
+
readonly now: () => number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_HOST_YIELD_CADENCE: HostYieldCadence;
|
|
19
|
+
export interface HostYieldGate {
|
|
20
|
+
/** Restarts the budget, for example at the start of a run and after each host yield finishes. */
|
|
21
|
+
restart(): void;
|
|
22
|
+
/** True once the budget since the last restart is spent. */
|
|
23
|
+
due(): boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function createHostYieldGate(cadence?: HostYieldCadence): HostYieldGate;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Internal: decides how often native tile loops yield to the host (browser) event loop.
|
|
4
|
+
*
|
|
5
|
+
* Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`
|
|
6
|
+
* callback is awaited only once the work since the last yield reaches a time budget, and always
|
|
7
|
+
* after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA
|
|
8
|
+
* (colour filter array) and noise-seed indexing, and every output value are unaffected.
|
|
9
|
+
* Not exported from the package.
|
|
10
|
+
*/
|
|
11
|
+
/** Default work budget between host yields: about half of a 60 Hz frame. */
|
|
12
|
+
export const HOST_YIELD_BUDGET_MILLISECONDS = 8;
|
|
13
|
+
export const DEFAULT_HOST_YIELD_CADENCE = Object.freeze({
|
|
14
|
+
budgetMilliseconds: HOST_YIELD_BUDGET_MILLISECONDS,
|
|
15
|
+
now: () => performance.now()
|
|
16
|
+
});
|
|
17
|
+
export function createHostYieldGate(cadence = DEFAULT_HOST_YIELD_CADENCE) {
|
|
18
|
+
const { budgetMilliseconds, now } = cadence;
|
|
19
|
+
let since = now();
|
|
20
|
+
return {
|
|
21
|
+
restart() { since = now(); },
|
|
22
|
+
due() { return budgetMilliseconds <= 0 || now() - since >= budgetMilliseconds; }
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=host-yield-cadence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-yield-cadence.js","sourceRoot":"","sources":["../../src/capture/host-yield-cadence.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAShD,MAAM,CAAC,MAAM,0BAA0B,GAAqB,MAAM,CAAC,MAAM,CAAC;IACxE,kBAAkB,EAAE,8BAA8B;IAClD,GAAG,EAAE,GAAW,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE;CACrC,CAAC,CAAC;AASH,MAAM,UAAU,mBAAmB,CAAC,UAA4B,0BAA0B;IACxF,MAAM,EAAC,kBAAkB,EAAE,GAAG,EAAC,GAAG,OAAO,CAAC;IAC1C,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;IAClB,OAAO;QACL,OAAO,KAAW,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;QAClC,GAAG,KAAc,OAAO,kBAAkB,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,KAAK,IAAI,kBAAkB,CAAC,CAAC,CAAC;KAC1F,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Internal: decides how often native tile loops yield to the host (browser) event loop.\n *\n * Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`\n * callback is awaited only once the work since the last yield reaches a time budget, and always\n * after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA\n * (colour filter array) and noise-seed indexing, and every output value are unaffected.\n * Not exported from the package.\n */\n\n/** Default work budget between host yields: about half of a 60 Hz frame. */\nexport const HOST_YIELD_BUDGET_MILLISECONDS = 8;\n\nexport interface HostYieldCadence {\n /** Yield once at least this many milliseconds (monotonic clock) have passed since the last yield. 0 yields after every tile. */\n readonly budgetMilliseconds: number;\n /** Monotonic clock in milliseconds. */\n readonly now: () => number;\n}\n\nexport const DEFAULT_HOST_YIELD_CADENCE: HostYieldCadence = Object.freeze({\n budgetMilliseconds: HOST_YIELD_BUDGET_MILLISECONDS,\n now: (): number => performance.now()\n});\n\nexport interface HostYieldGate {\n /** Restarts the budget, for example at the start of a run and after each host yield finishes. */\n restart(): void;\n /** True once the budget since the last restart is spent. */\n due(): boolean;\n}\n\nexport function createHostYieldGate(cadence: HostYieldCadence = DEFAULT_HOST_YIELD_CADENCE): HostYieldGate {\n const {budgetMilliseconds, now} = cadence;\n let since = now();\n return {\n restart(): void { since = now(); },\n due(): boolean { return budgetMilliseconds <= 0 || now() - since >= budgetMilliseconds; }\n };\n}\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type CalculationResult } from "../core/calculation-result.js";
|
|
2
2
|
import { type SimulatedCapture, type CaptureLinearPlane, type CaptureLinearImageState } from "./simulated-capture.js";
|
|
3
3
|
export declare const LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION: "0.1.0";
|
|
4
|
-
/**
|
|
4
|
+
/** Version of the `uniform-linear-capture-uint16` model. 0.2.0 made rounding exact: nearest, ties up (Math.round). */
|
|
5
|
+
export declare const LINEAR_CAPTURE_ENCODING_MODEL_VERSION: "0.2.0";
|
|
6
|
+
/** The same linear mapping for every channel. The reference white value comes from the source plane. */
|
|
5
7
|
export interface LinearCaptureEncoding {
|
|
6
8
|
schemaVersion: typeof LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION;
|
|
7
9
|
/** Relative source sample value assigned blackCode; may be negative. */
|
|
8
10
|
blackValue: number;
|
|
9
|
-
/** Integer code
|
|
11
|
+
/** Integer code for blackValue, 0..65534. A nonzero offset can keep negative samples. */
|
|
10
12
|
blackCode: number;
|
|
11
13
|
/** Code at the plane's referenceWhiteValue, strictly above blackCode, at most 65535. */
|
|
12
14
|
referenceWhiteCode: number;
|
|
@@ -14,20 +16,20 @@ export interface LinearCaptureEncoding {
|
|
|
14
16
|
outOfRange: "clip" | "reject";
|
|
15
17
|
rounding: "nearest-ties-up";
|
|
16
18
|
}
|
|
17
|
-
/**
|
|
19
|
+
/** Strictly parses an encoding profile. It never fills in a default clipping or rounding policy. */
|
|
18
20
|
export declare function parseLinearCaptureEncoding(value: unknown): LinearCaptureEncoding;
|
|
19
21
|
export interface LinearCaptureEncodingInput {
|
|
20
22
|
capture: SimulatedCapture;
|
|
21
23
|
planeId: string;
|
|
22
|
-
/**
|
|
24
|
+
/** Identifies the exact source plane, so a plane with a different meaning cannot be swapped in. */
|
|
23
25
|
requiredImageState: CaptureLinearImageState;
|
|
24
26
|
encoding: LinearCaptureEncoding;
|
|
25
27
|
}
|
|
26
|
-
/**
|
|
28
|
+
/** 16-bit unsigned codes, not tied to a file format. The metadata keeps their colour, white-balance (WB) and saturation meaning. */
|
|
27
29
|
export interface EncodedLinearCapture {
|
|
28
30
|
schemaVersion: typeof LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION;
|
|
29
31
|
captureId: string;
|
|
30
|
-
/**
|
|
32
|
+
/** Cleaned-up copy of the capture's geometry, settings, WB, adopted white and model provenance, without the float planes. */
|
|
31
33
|
captureMetadata: Omit<SimulatedCapture, "planes">;
|
|
32
34
|
sourcePlane: Omit<CaptureLinearPlane, "storage">;
|
|
33
35
|
encoding: LinearCaptureEncoding;
|
|
@@ -40,20 +42,20 @@ export interface EncodedLinearCapture {
|
|
|
40
42
|
scale: number;
|
|
41
43
|
minimumRepresentableValue: number;
|
|
42
44
|
maximumRepresentableValue: number;
|
|
43
|
-
/**
|
|
45
|
+
/** Headroom: (maximum value − black) / (reference white − black). */
|
|
44
46
|
headroomFactor: number;
|
|
45
|
-
/**
|
|
47
|
+
/** Largest rounding error for in-range samples, 0.5/scale. Clipping error is not included. */
|
|
46
48
|
maximumRoundingError: number;
|
|
47
49
|
clippedLowSampleCount: number;
|
|
48
50
|
clippedHighSampleCount: number;
|
|
49
|
-
/**
|
|
51
|
+
/** Linear encoding never picks a default rendering exposure or display white. */
|
|
50
52
|
defaultRenderingExposureEv: null;
|
|
51
53
|
samples: readonly number[];
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
56
|
+
* Converts one inline float plane to integer codes. The capture data is not changed.
|
|
57
|
+
*
|
|
55
58
|
* Mapping: blackCode + (sample-blackValue)/(referenceWhiteValue-blackValue)
|
|
56
|
-
* * (referenceWhiteCode-blackCode).
|
|
59
|
+
* * (referenceWhiteCode-blackCode). It clips only when the policy says so, then rounds.
|
|
57
60
|
*/
|
|
58
61
|
export declare function calculateLinearCaptureEncoding(input: LinearCaptureEncodingInput): CalculationResult<EncodedLinearCapture>;
|
|
59
|
-
//# sourceMappingURL=linear-encoding.d.ts.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Quantizes one immutable inline float plane without changing its capture data. Mapping: blackCode +
|
|
6
|
-
* (sample-blackValue)/(referenceWhiteValue-blackValue) * (referenceWhiteCode-blackCode). Clips only
|
|
7
|
-
* under explicit policy, then rounds.
|
|
3
|
+
* Linear capture encoding: converts a floating-point capture plane to 16-bit unsigned integer
|
|
4
|
+
* codes with a uniform linear mapping. The capture itself is not changed.
|
|
8
5
|
* @see docs/LINEAR_CAPTURE_ENCODING.md for equations, coordinate/unit conventions, blockers and
|
|
9
6
|
* support limits.
|
|
10
7
|
*/
|
|
@@ -13,10 +10,12 @@ import { calculatedResult } from "../core/calculation-result.js";
|
|
|
13
10
|
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
14
11
|
import { parseSimulatedCapture } from "./simulated-capture.js";
|
|
15
12
|
export const LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION = "0.1.0";
|
|
13
|
+
/** Version of the `uniform-linear-capture-uint16` model. 0.2.0 made rounding exact: nearest, ties up (Math.round). */
|
|
14
|
+
export const LINEAR_CAPTURE_ENCODING_MODEL_VERSION = "0.2.0";
|
|
16
15
|
function record(value, keys) {
|
|
17
16
|
return requireAllowlistedRecord(value, keys, "Invalid linear encoding fields.");
|
|
18
17
|
}
|
|
19
|
-
/**
|
|
18
|
+
/** Strictly parses an encoding profile. It never fills in a default clipping or rounding policy. */
|
|
20
19
|
export function parseLinearCaptureEncoding(value) {
|
|
21
20
|
const r = record(value, ["schemaVersion", "blackValue", "blackCode", "referenceWhiteCode", "negativeValues", "outOfRange", "rounding"]);
|
|
22
21
|
if (r.schemaVersion !== LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION || typeof r.blackValue !== "number" || !Number.isFinite(r.blackValue) ||
|
|
@@ -31,9 +30,10 @@ export function parseLinearCaptureEncoding(value) {
|
|
|
31
30
|
outOfRange: r.outOfRange, rounding: r.rounding };
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
33
|
+
* Converts one inline float plane to integer codes. The capture data is not changed.
|
|
34
|
+
*
|
|
35
35
|
* Mapping: blackCode + (sample-blackValue)/(referenceWhiteValue-blackValue)
|
|
36
|
-
* * (referenceWhiteCode-blackCode).
|
|
36
|
+
* * (referenceWhiteCode-blackCode). It clips only when the policy says so, then rounds.
|
|
37
37
|
*/
|
|
38
38
|
export function calculateLinearCaptureEncoding(input) {
|
|
39
39
|
const r = record(input, ["capture", "planeId", "requiredImageState", "encoding"]);
|
|
@@ -60,7 +60,7 @@ export function calculateLinearCaptureEncoding(input) {
|
|
|
60
60
|
const samples = plane.storage.samples.map((sample) => {
|
|
61
61
|
if (encoding.negativeValues === "reject" && sample < 0)
|
|
62
62
|
throw new InvalidConfigurationError("Negative source values are rejected by encoding policy.");
|
|
63
|
-
// Compare
|
|
63
|
+
// Compare against the limits in source units first, so a huge finite value can clip without overflowing.
|
|
64
64
|
if (sample < minimum || sample > maximum) {
|
|
65
65
|
if (encoding.outOfRange === "reject")
|
|
66
66
|
throw new InvalidConfigurationError("Source value exceeds the encoded range.");
|
|
@@ -80,18 +80,19 @@ export function calculateLinearCaptureEncoding(input) {
|
|
|
80
80
|
if (sample === plane.referenceWhiteValue)
|
|
81
81
|
return encoding.referenceWhiteCode;
|
|
82
82
|
const mapped = encoding.blackCode + (sample - encoding.blackValue) / width * codeWidth;
|
|
83
|
-
// Round nearest
|
|
84
|
-
|
|
83
|
+
// Round to nearest; exact ties go to the larger code (Math.round; Math.floor(x+.5) wrongly rounds
|
|
84
|
+
// 0.49999999999999994 up). Clamp only rounding error at the end points; Math.max(0, -0) is +0.
|
|
85
|
+
return Math.max(0, Math.min(65535, Math.round(mapped)));
|
|
85
86
|
});
|
|
86
87
|
const { storage: _storage, ...sourcePlane } = plane;
|
|
87
88
|
const { planes: _planes, ...captureMetadata } = capture;
|
|
88
89
|
void _storage;
|
|
89
|
-
void _planes; //
|
|
90
|
+
void _planes; // The float sample arrays are deliberately left out of the encoded metadata.
|
|
90
91
|
return calculatedResult({ schemaVersion: LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION, captureId: capture.captureId, captureMetadata, sourcePlane,
|
|
91
92
|
encoding, sampleLayout: "row-major-interleaved", bitDepth: 16, codeMinimum: 0, codeMaximum: 65535,
|
|
92
93
|
referenceWhiteValue: plane.referenceWhiteValue, scale, minimumRepresentableValue: minimum, maximumRepresentableValue: maximum,
|
|
93
94
|
headroomFactor: (65535 - encoding.blackCode) / codeWidth, maximumRoundingError: .5 / scale,
|
|
94
|
-
clippedLowSampleCount: low, clippedHighSampleCount: high, defaultRenderingExposureEv: null, samples }, "uniform-linear-capture-uint16",
|
|
95
|
+
clippedLowSampleCount: low, clippedHighSampleCount: high, defaultRenderingExposureEv: null, samples }, "uniform-linear-capture-uint16", LINEAR_CAPTURE_ENCODING_MODEL_VERSION, ["Deterministic unsigned linear codes; no dithering, transfer curve, tone mapping or serializer tags",
|
|
95
96
|
"Reference white, capture saturation history, integer maximum and display white remain separate",
|
|
96
97
|
"In-range error bound covers ideal rounding only; binary64 arithmetic can add floating-point error"]);
|
|
97
98
|
}
|