@photivra/engine 2.20.0 → 2.22.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 +295 -1
- package/CITATION.cff +1 -1
- package/README.md +7 -6
- package/SECURITY.md +1 -1
- package/THIRD_PARTY.md +18 -0
- package/dist/capture/c2pa-embed.d.ts +116 -0
- package/dist/capture/c2pa-embed.js +493 -0
- package/dist/capture/c2pa-embed.js.map +1 -0
- package/dist/capture/dng-import.d.ts +73 -8
- package/dist/capture/dng-import.js +315 -80
- package/dist/capture/dng-import.js.map +1 -1
- package/dist/capture/dng-lens-correction-opcodes.d.ts +2 -2
- package/dist/capture/dng-lens-correction-opcodes.js +2 -2
- package/dist/capture/dng-lens-correction-opcodes.js.map +1 -1
- package/dist/capture/dng-opcodes.d.ts +96 -0
- package/dist/capture/dng-opcodes.js +391 -0
- package/dist/capture/dng-opcodes.js.map +1 -0
- package/dist/capture/dng-profile-maps.d.ts +99 -0
- package/dist/capture/dng-profile-maps.js +381 -0
- package/dist/capture/dng-profile-maps.js.map +1 -0
- package/dist/capture/dng-stage-image.d.ts +23 -0
- package/dist/capture/dng-stage-image.js +65 -0
- package/dist/capture/dng-stage-image.js.map +1 -0
- package/dist/capture/exposure-build-up-stage.d.ts +16 -0
- package/dist/capture/exposure-build-up-stage.js +4 -0
- package/dist/capture/exposure-build-up-stage.js.map +1 -0
- package/dist/capture/jpeg-xl-tiles.d.ts +22 -0
- package/dist/capture/jpeg-xl-tiles.js +151 -0
- package/dist/capture/jpeg-xl-tiles.js.map +1 -0
- package/dist/capture/lossy-jpeg.d.ts +17 -0
- package/dist/capture/lossy-jpeg.js +369 -0
- package/dist/capture/lossy-jpeg.js.map +1 -0
- package/dist/capture/native-environment-lean.d.ts +2 -1
- package/dist/capture/native-environment-lean.js +41 -73
- package/dist/capture/native-environment-lean.js.map +1 -1
- package/dist/capture/native-environment-tabulated.js +4 -3
- package/dist/capture/native-environment-tabulated.js.map +1 -1
- package/dist/capture/native-raw-development.d.ts +2 -1
- package/dist/capture/native-raw-development.js.map +1 -1
- package/dist/capture/native-raw.d.ts +3 -2
- package/dist/capture/native-raw.js +5 -4
- package/dist/capture/native-raw.js.map +1 -1
- package/dist/capture/sensor-raw-producer.d.ts +4 -1
- package/dist/capture/sensor-raw-producer.js +12 -3
- package/dist/capture/sensor-raw-producer.js.map +1 -1
- package/dist/color/neighbor-highlight-reconstruction.d.ts +66 -0
- package/dist/color/neighbor-highlight-reconstruction.js +234 -0
- package/dist/color/neighbor-highlight-reconstruction.js.map +1 -0
- package/dist/color/sensor-color-development.d.ts +5 -0
- package/dist/color/sensor-color-development.js +7 -1
- package/dist/color/sensor-color-development.js.map +1 -1
- package/dist/color/spectral-spikiness.d.ts +11 -0
- package/dist/color/spectral-spikiness.js +23 -0
- package/dist/color/spectral-spikiness.js.map +1 -0
- package/dist/core/execution-error.d.ts +21 -0
- package/dist/core/execution-error.js +12 -0
- package/dist/core/execution-error.js.map +1 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/equipment/generic-lens-catalogue.d.ts +3 -2
- package/dist/equipment/generic-lens-catalogue.js +18 -5
- package/dist/equipment/generic-lens-catalogue.js.map +1 -1
- package/dist/equipment/generic-tier-assets.d.ts +32 -0
- package/dist/equipment/generic-tier-assets.js +16 -11
- package/dist/equipment/generic-tier-assets.js.map +1 -1
- package/dist/equipment/sensor-profile-body.d.ts +78 -0
- package/dist/equipment/sensor-profile-body.js +77 -0
- package/dist/equipment/sensor-profile-body.js.map +1 -0
- package/dist/equipment/sensor-profiles.d.ts +8 -0
- package/dist/equipment/sensor-profiles.js +82 -0
- package/dist/equipment/sensor-profiles.js.map +1 -0
- package/dist/facade/catalogue-lens-signal.d.ts +28 -3
- package/dist/facade/catalogue-lens-signal.js +83 -78
- package/dist/facade/catalogue-lens-signal.js.map +1 -1
- package/dist/facade/chart-radiance-batch.js +2 -1
- package/dist/facade/chart-radiance-batch.js.map +1 -1
- package/dist/facade/defocus-image-space-provider.d.ts +7 -0
- package/dist/facade/defocus-image-space-provider.js +64 -76
- package/dist/facade/defocus-image-space-provider.js.map +1 -1
- package/dist/facade/diffraction-provider.d.ts +1 -1
- package/dist/facade/diffraction-provider.js +4 -4
- package/dist/facade/diffraction-provider.js.map +1 -1
- package/dist/facade/display-view-gpu-session.js +39 -5
- package/dist/facade/display-view-gpu-session.js.map +1 -1
- package/dist/facade/display-view-gpu.d.ts +19 -6
- package/dist/facade/display-view-gpu.js.map +1 -1
- package/dist/facade/display-view-lens-signal.js +25 -23
- package/dist/facade/display-view-lens-signal.js.map +1 -1
- package/dist/facade/display-view-normal.d.ts +15 -0
- package/dist/facade/display-view-normal.js +44 -0
- package/dist/facade/display-view-normal.js.map +1 -0
- package/dist/facade/display-view-rendering.d.ts +97 -0
- package/dist/facade/display-view-rendering.js +598 -0
- package/dist/facade/display-view-rendering.js.map +1 -0
- package/dist/facade/display-view.d.ts +37 -65
- package/dist/facade/display-view.js +152 -499
- package/dist/facade/display-view.js.map +1 -1
- package/dist/facade/expected-signal-setup.d.ts +3 -1
- package/dist/facade/expected-signal-setup.js +3 -3
- package/dist/facade/expected-signal-setup.js.map +1 -1
- package/dist/facade/expected-signal.d.ts +47 -14
- package/dist/facade/expected-signal.js +117 -112
- package/dist/facade/expected-signal.js.map +1 -1
- package/dist/facade/exposure-build-up.d.ts +70 -0
- package/dist/facade/exposure-build-up.js +164 -0
- package/dist/facade/exposure-build-up.js.map +1 -0
- package/dist/facade/fast-methods.d.ts +1 -1
- package/dist/facade/fast-methods.js +46 -9
- package/dist/facade/fast-methods.js.map +1 -1
- package/dist/facade/generic-lens-capture.d.ts +3 -3
- package/dist/facade/generic-lens-capture.js +3 -3
- package/dist/facade/generic-lens-capture.js.map +1 -1
- package/dist/facade/image-plane-enable.d.ts +7 -0
- package/dist/facade/image-plane-enable.js +17 -0
- package/dist/facade/image-plane-enable.js.map +1 -0
- package/dist/facade/image-plane-lattice-data.d.ts +6 -0
- package/dist/facade/image-plane-lattice-data.js +10 -0
- package/dist/facade/image-plane-lattice-data.js.map +1 -0
- package/dist/facade/image-plane-support.d.ts +33 -0
- package/dist/facade/image-plane-support.js +11 -0
- package/dist/facade/image-plane-support.js.map +1 -0
- package/dist/facade/image-plane.d.ts +36 -0
- package/dist/facade/image-plane.js +384 -0
- package/dist/facade/image-plane.js.map +1 -0
- package/dist/facade/mixed-illumination.d.ts +108 -0
- package/dist/facade/mixed-illumination.js +174 -0
- package/dist/facade/mixed-illumination.js.map +1 -0
- package/dist/facade/on-demand-kits.d.ts +14 -0
- package/dist/facade/on-demand-kits.js +36 -0
- package/dist/facade/on-demand-kits.js.map +1 -0
- package/dist/facade/opt-in-kit.d.ts +9 -0
- package/dist/facade/opt-in-kit.js +11 -0
- package/dist/facade/opt-in-kit.js.map +1 -0
- package/dist/facade/quality-kit.d.ts +21 -0
- package/dist/facade/quality-kit.js +23 -0
- package/dist/facade/quality-kit.js.map +1 -0
- package/dist/facade/quality-paths.d.ts +22 -0
- package/dist/facade/quality-paths.js +44 -0
- package/dist/facade/quality-paths.js.map +1 -0
- package/dist/facade/representative-light-sources.d.ts +72 -0
- package/dist/facade/representative-light-sources.js +124 -0
- package/dist/facade/representative-light-sources.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +145 -4
- package/dist/facade/scene-radiance.js +50 -13
- package/dist/facade/scene-radiance.js.map +1 -1
- package/dist/facade/simulate-capture.d.ts +68 -20
- package/dist/facade/simulate-capture.js +399 -146
- package/dist/facade/simulate-capture.js.map +1 -1
- package/dist/facade/simulate-display-view.d.ts +10 -12
- package/dist/facade/simulate-display-view.js +70 -53
- package/dist/facade/simulate-display-view.js.map +1 -1
- package/dist/gpu/chart-composite-gpu.d.ts +13 -1
- package/dist/gpu/chart-composite-gpu.js +48 -9
- package/dist/gpu/chart-composite-gpu.js.map +1 -1
- package/dist/gpu/chart-radiance-gpu.js +4 -30
- package/dist/gpu/chart-radiance-gpu.js.map +1 -1
- package/dist/gpu/display-view-composite-material-module.d.ts +10 -4
- package/dist/gpu/display-view-composite-material-module.js +39 -13
- package/dist/gpu/display-view-composite-material-module.js.map +1 -1
- package/dist/gpu/display-view-gpu-renderer.d.ts +43 -0
- package/dist/gpu/display-view-gpu-renderer.js +134 -0
- package/dist/gpu/display-view-gpu-renderer.js.map +1 -0
- package/dist/gpu/display-view-image-material-module.d.ts +87 -0
- package/dist/gpu/display-view-image-material-module.js +361 -0
- package/dist/gpu/display-view-image-material-module.js.map +1 -0
- package/dist/gpu/display-view-image-quality.d.ts +87 -0
- package/dist/gpu/display-view-image-quality.js +625 -0
- package/dist/gpu/display-view-image-quality.js.map +1 -0
- package/dist/gpu/display-view-quality-gpu.d.ts +80 -65
- package/dist/gpu/display-view-quality-gpu.js +187 -445
- package/dist/gpu/display-view-quality-gpu.js.map +1 -1
- package/dist/gpu/display-view-speed-gpu.d.ts +67 -19
- package/dist/gpu/display-view-speed-gpu.js +181 -105
- package/dist/gpu/display-view-speed-gpu.js.map +1 -1
- package/dist/gpu/image-kernel-accelerator.js +3 -0
- package/dist/gpu/image-kernel-accelerator.js.map +1 -1
- package/dist/gpu/image-kernel-execution.d.ts +2 -13
- package/dist/gpu/image-kernel-execution.js +2 -10
- package/dist/gpu/image-kernel-execution.js.map +1 -1
- package/dist/gpu/wgsl-display-view-coupled-stub.d.ts +8 -0
- package/dist/gpu/wgsl-display-view-coupled-stub.js +21 -0
- package/dist/gpu/wgsl-display-view-coupled-stub.js.map +1 -0
- package/dist/gpu/wgsl-display-view-coupled.d.ts +88 -0
- package/dist/gpu/wgsl-display-view-coupled.js +353 -0
- package/dist/gpu/wgsl-display-view-coupled.js.map +1 -0
- package/dist/gpu/wgsl-display-view-quality-kernel.d.ts +33 -24
- package/dist/gpu/wgsl-display-view-quality-kernel.js +166 -146
- package/dist/gpu/wgsl-display-view-quality-kernel.js.map +1 -1
- package/dist/gpu/wgsl-display-view-speed-kernel.d.ts +19 -44
- package/dist/gpu/wgsl-display-view-speed-kernel.js +116 -18
- package/dist/gpu/wgsl-display-view-speed-kernel.js.map +1 -1
- package/dist/gpu/wgsl-exact-sum.d.ts +20 -0
- package/dist/gpu/wgsl-exact-sum.js +42 -0
- package/dist/gpu/wgsl-exact-sum.js.map +1 -0
- package/dist/index.d.ts +22 -6
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/motion/subject-motion.d.ts +66 -0
- package/dist/motion/subject-motion.js +52 -0
- package/dist/motion/subject-motion.js.map +1 -0
- package/dist/optics/generic-lens-lateral-color.d.ts +83 -0
- package/dist/optics/generic-lens-lateral-color.js +77 -0
- package/dist/optics/generic-lens-lateral-color.js.map +1 -0
- package/dist/optics/generic-lens-psf.js +54 -46
- package/dist/optics/generic-lens-psf.js.map +1 -1
- package/dist/optics/lens-psf-profile.d.ts +7 -0
- package/dist/optics/lens-psf-profile.js +2 -1
- package/dist/optics/lens-psf-profile.js.map +1 -1
- package/dist/output/camera-channel-response.d.ts +50 -0
- package/dist/output/camera-channel-response.js +69 -0
- package/dist/output/camera-channel-response.js.map +1 -0
- package/dist/output/developed-lens-corrections.d.ts +19 -5
- package/dist/output/developed-lens-corrections.js +28 -9
- package/dist/output/developed-lens-corrections.js.map +1 -1
- package/dist/output/generic-lens-corrections.d.ts +41 -5
- package/dist/output/generic-lens-corrections.js +52 -8
- package/dist/output/generic-lens-corrections.js.map +1 -1
- package/dist/output/native-capture-sdr.js +5 -2
- package/dist/output/native-capture-sdr.js.map +1 -1
- package/dist/output/print-plan.d.ts +41 -5
- package/dist/output/print-plan.js +59 -14
- package/dist/output/print-plan.js.map +1 -1
- package/dist/output/sdr-rendering.d.ts +18 -1
- package/dist/output/sdr-rendering.js +39 -2
- package/dist/output/sdr-rendering.js.map +1 -1
- package/dist/sensor/binomial-sample.d.ts +3 -0
- package/dist/sensor/binomial-sample.js +86 -0
- package/dist/sensor/binomial-sample.js.map +1 -0
- package/dist/sensor/native-sensor-report.d.ts +10 -0
- package/dist/sensor/native-sensor-report.js +16 -0
- package/dist/sensor/native-sensor-report.js.map +1 -0
- package/dist/sensor/sensor-characteristics.d.ts +91 -13
- package/dist/sensor/sensor-characteristics.js +30 -15
- package/dist/sensor/sensor-characteristics.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -0
- package/docs/API_REFERENCE.md +214 -4
- package/docs/QUICK_START.md +162 -8
- package/docs/USAGE.md +195 -22
- package/docs/api/capture-c2pa-embed.md +177 -0
- package/docs/api/capture-dng-import.md +86 -10
- package/docs/api/capture-dng-opcodes.md +93 -0
- package/docs/api/capture-dng-profile-maps.md +141 -0
- package/docs/api/capture-dng-stage-image.md +43 -0
- package/docs/api/capture-jpeg-xl-tiles.md +33 -0
- package/docs/api/capture-lossy-jpeg.md +41 -0
- package/docs/api/capture-native-raw-development.md +2 -1
- package/docs/api/core-execution-error.md +43 -0
- package/docs/api/core-version.md +1 -1
- package/docs/api/equipment-generic-lens-catalogue.md +10 -5
- package/docs/api/equipment-sensor-profile-body.md +64 -0
- package/docs/api/equipment-sensor-profiles.md +86 -0
- package/docs/api/exports.json +460 -5
- package/docs/api/facade-display-view-gpu.md +5 -2
- package/docs/api/facade-display-view.md +11 -15
- package/docs/api/facade-exposure-build-up.md +105 -0
- package/docs/api/facade-fast-methods.md +47 -10
- package/docs/api/facade-image-plane-enable.md +16 -0
- package/docs/api/facade-mixed-illumination.md +67 -0
- package/docs/api/facade-quality-paths.md +24 -0
- package/docs/api/facade-representative-light-sources.md +131 -0
- package/docs/api/facade-scene-radiance.md +54 -3
- package/docs/api/facade-simulate-capture.md +48 -11
- package/docs/api/facade-simulate-display-view.md +10 -12
- package/docs/api/gpu-image-kernel-execution.md +0 -36
- package/docs/api/motion-subject-motion.md +23 -0
- package/docs/api/optics-generic-lens-lateral-color.md +79 -0
- package/docs/api/output-camera-channel-response.md +55 -0
- package/docs/api/output-developed-lens-corrections.md +10 -1
- package/docs/api/output-generic-lens-corrections.md +40 -4
- package/docs/api/output-print-plan.md +35 -1
- package/docs/api/output-sdr-rendering.md +6 -1
- package/docs/api/sensor-sensor-characteristics.md +54 -2
- package/llms.txt +3 -0
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-lens-catalogue.js","sourceRoot":"","sources":["../../src/equipment/generic-lens-catalogue.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAIlI,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC5G,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAmErJ,kGAAkG;AAClG,MAAM,CAAC,MAAM,0BAA0B,GAA2E,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9I,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI;QAC1J,oBAAoB,EAAE,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,aA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,IAAI,EAAE,gBAAgB,EAAE,eAAwB,EAAE,CAAC,CAAC;AACrI,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Generic lens catalogue (#549): two sets of primes, Professional and Consumer, named \"PV <focal length> <maximum aperture>\"\n * (\"Pro\" for the professional set, \"Macro\" or \"Fisheye\" before it for special lenses). Every lens is Photivra's own generic\n * design, not modelled on any manufacturer's product, and every number in this file is a labelled approximation chosen by\n * Photivra to reproduce the typical behaviour that openly published optics texts describe for each class of lens. No\n * measured, branded or paid lens data is used.\n *\n * The data here are the lens definitions and their character as numbers (a set baseline and per-lens adjustments); the\n * PSF built from them lives in `optics/generic-lens-psf.ts`, so other models (for example bokeh, #553) can read the same\n * data. Each lens's numbers are resolved for a sensor (focal lengths scale by the crop factor as for `lens.prime`), an\n * f-number and a focus distance by {@link resolveGenericLens}.\n *\n * Models (each an approximation):\n * - Primary (Seidel) wave aberrations at the lens's widest aperture and at the frame corner (normalised field H = 1):\n * spherical W040, coma W131, astigmatism W222 and field curvature W220, in waves at 550 nm (Hopkins 1950; Wyant & Creath\n * 1992, Applied Optics and Optical Engineering XI ch. 1, free author copy). Stopping down from N0 to N scales the pupil\n * radius by a = N0/N and so each term W_klm·ρ^l by a^l (a⁴, a³, a², a²). Spherical aberration is balanced by defocus\n * W020 = −W040, the focus of minimum RMS wavefront error (Wyant & Creath 1992, sec. on balanced aberrations).\n * - Close focus: every aberration is multiplied by 1 + c·m/m_max, where m is the thin-lens magnification at the focus\n * distance and c the lens's close-focus factor (a generic stand-in for the change of aberrations with conjugate).\n * - Axial (longitudinal) colour: an extra defocus W020(λ) = W_ax·a²·D(λ), and lateral colour: a radial image displacement\n * Δr(λ) = L·R·H·D(λ) (R the frame's half-diagonal), both with the normalised Cauchy dispersion\n * D(λ) = (1/λ² − 1/λ_d²)/(1/λ_F² − 1/λ_C²) (Fraunhofer d, F and C lines; `calculateCauchyRefractiveIndex`).\n * - Distortion: radial r_d = r·(1 + k1·ρ²), ρ normalised to the frame's half-diagonal, so k1 is the corner distortion.\n * - Vignetting: relative illumination E(ρ) = (1 − b·ρ²)² with E(1) = 2^−s, s the corner fall-off in stops: a natural part,\n * plus an optical part that fades over the first four stops of stopping down (log2(N/N0) = 2 is four stops, since a\n * stop is a factor √2 in N).\n * - Bokeh (#567), the options of `lens.defocus` (#553) that `simulateCapture` folds into the PSF with `lens.defocus`: rounded\n * aperture blades (9 at curvature 0.7 for the professional set, 7 at 0.3 for the consumer set, open to a circle at the widest\n * aperture), the lens's own W040 as `sphericalAberration`, and, for the fast (f/2 or faster) rectilinear wides and normals\n * (at most 50 mm equivalent), a cat's eye: one clipping circle of the widest pupil's radius whose shift leaves the open area\n * 2^−s_o of the pupil at the frame corner wide open, s_o the lens's optical vignetting in stops (the light it removes is the\n * optical part of the relative illumination above; the kernel is a shape only).\n * - Flare, focus breathing and focus consistency are numbers for callers; `simulateCapture` renders none of them.\n * @see docs/LENS_CATALOGUE.md for the tables, the adjustments and why each lens has them.\n */\n\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport { requireInputKeys, requireInputObject } from \"../core/record-validation.js\";\nimport type { EvidenceProvenance } from \"../core/evidence-provenance.js\";\nimport { calculateEquivalentFocalLength35Mm } from \"../camera/equivalent-focal-length.js\";\nimport type { LensProjectionModel } from \"../camera/lens-projection.js\";\nimport { FRAUNHOFER_C_LINE_NM, FRAUNHOFER_D_LINE_NM, FRAUNHOFER_F_LINE_NM } from \"../optics/longitudinal-chromatic-aberration.js\";\nimport type { RadialDistortionProfile } from \"../optics/radial-distortion.js\";\nimport type { IlluminationVignettingProfile } from \"../optics/illumination-vignetting.js\";\nimport type { DefocusBokehOptions } from \"../optics/defocus-bokeh-kernel.js\";\nimport { portableAsin } from \"../core/portable-math.js\";\nimport { GENERIC_PRIME_MINIMUM_FOCUS, GENERIC_PRIME_THIRD_STOP_F_NUMBERS } from \"./generic-prime-lenses.js\";\nimport { createDeterministicUniformStream, deriveNativeSiteStreamSeedUint32, sampleDeterministicStandardNormal } from \"../sensor/stochastic-seed.js\";\n\nexport type GenericLensSet = \"professional\" | \"consumer\";\nexport type GenericLensKind = \"standard\" | \"macro\" | \"fisheye\";\n\n/** The character of a set, at each lens's widest aperture. Aberrations are in waves at 550 nm at the frame corner. */\nexport interface GenericLensCharacterValues {\n /** Spherical aberration W040 (balanced by W020 = −W040): centre sharpness. */\n sphericalWaves: number;\n /** Coma W131 at H = 1: the comet-shaped point images of night photography. */\n comaWaves: number;\n /** Astigmatism W222 at H = 1: edge and corner sharpness. */\n astigmatismWaves: number;\n /** Field curvature W220 at H = 1: edge and corner sharpness. */\n fieldCurvatureWaves: number;\n /** Axial colour: the F-to-C difference of the defocus W020, waves at 550 nm. */\n axialColorWaves: number;\n /** Lateral colour: the F-to-C difference of the image radius at the corner, as a fraction of the half-diagonal. */\n lateralColorFraction: number;\n /** Corner distortion magnitude |k1| (fraction); each lens gives the sign (barrel −, pincushion +). */\n distortionMagnitude: number;\n /** Corner fall-off in stops that stays when stopped down (natural vignetting). */\n naturalVignettingStops: number;\n /** Extra corner fall-off in stops at the widest aperture (optical vignetting); gone four stops down (N = 4·N0). */\n opticalVignettingStops: number;\n /** Veiling glare: the fraction of the image's mean irradiance spread as a uniform veil. */\n veilingGlareFraction: number;\n /** Peak ghost power as a fraction of a bright source's power on the axis. */\n ghostFraction: number;\n /** Field-of-view change between infinity and minimum focus as a fraction (negative: narrower), beyond thin-lens unit focusing. */\n breathingFraction: number;\n /** Standard deviation of the autofocus error as a fraction of the depth of focus 2·N·c. */\n focusScatterDepthOfFocusFraction: number;\n /** c in the close-focus factor 1 + c·m/m_max. */\n closeFocusFactor: number;\n}\n\n/** Per-lens multipliers of the set baseline (missing: 1). `distortion` is signed and required: −1 barrel, +1 pincushion at the baseline. */\nexport type GenericLensAdjustments = { distortion: number } & Partial<Record<\"spherical\" | \"coma\" | \"astigmatism\" | \"fieldCurvature\" | \"axialColor\" | \"lateralColor\" |\n \"vignetting\" | \"strayLight\" | \"breathing\" | \"focusScatter\" | \"closeFocus\", number>>;\n\nexport interface GenericLensCatalogueEntry {\n /** Catalogue id, for example \"pv-50-1.2-pro\". */\n lensId: string;\n /** Display name, for example \"PV 50 1.2 Pro\". */\n name: string;\n set: GenericLensSet;\n kind: GenericLensKind;\n /** Full-frame-equivalent focal length (36 × 24 mm reference). */\n equivalentFocalLengthMm: number;\n widestFNumber: number;\n narrowestFNumber: number;\n /** Largest magnification: 0.15 (the generic rule) or 1 for the professional macro. */\n maximumMagnification: number;\n projection: LensProjectionModel;\n /** Fisheyes only: a circular image inside the frame, or one that fills it. */\n fisheyeImage?: \"circular\" | \"full-frame\";\n adjustments: Readonly<GenericLensAdjustments>;\n /** Why this lens departs from its set's baseline. */\n note: string;\n /**\n * A short plain-English summary of the lens's character (at most 40 characters, US spelling), written from its adjustments and\n * `note`, for lists and pickers. It describes the lens's sharpness, color, distortion and falloff, not its bokeh (the same rule for every lens of a set).\n */\n summary: string;\n}\n\n/** The set baselines (owner's table, #549), each lens's starting point before its adjustments. */\nexport const GENERIC_LENS_SET_BASELINES: Readonly<Record<GenericLensSet, Readonly<GenericLensCharacterValues>>> = /* @__PURE__ */ Object.freeze({\n professional: /* @__PURE__ */ Object.freeze({ sphericalWaves: 0.25, comaWaves: 0.35, astigmatismWaves: 0.3, fieldCurvatureWaves: 0.15, axialColorWaves: 0.15,\n lateralColorFraction: 0.00008, distortionMagnitude: 0.01, naturalVignettingStops: 0.4, opticalVignettingStops: 0.6, veilingGlareFraction: 0.005, ghostFraction: 0.002,\n breathingFraction: -0.03, focusScatterDepthOfFocusFraction: 0.1, closeFocusFactor: 0.15 }),\n consumer: /* @__PURE__ */ Object.freeze({ sphericalWaves: 0.5, comaWaves: 1.0, astigmatismWaves: 0.8, fieldCurvatureWaves: 0.45, axialColorWaves: 0.4,\n lateralColorFraction: 0.0003, distortionMagnitude: 0.03, naturalVignettingStops: 0.7, opticalVignettingStops: 1.1, veilingGlareFraction: 0.02, ghostFraction: 0.008,\n breathingFraction: -0.08, focusScatterDepthOfFocusFraction: 0.3, closeFocusFactor: 0.5 })\n});\n\n/** The generic smallest aperture of both sets: f/16 up to 16 mm, f/22 up to 135 mm, f/32 beyond (as `lens.prime`). */\nfunction narrowest(equivalent: number): number { return equivalent <= 16 ? 16 : equivalent <= 135 ? 22 : 32; }\n\ntype Row = [focal: number, widest: number, kind: GenericLensKind, adjustments: GenericLensAdjustments, note: string, summary: string, fisheye?: \"circular\" | \"full-frame\"];\nconst PRO: readonly Row[] = [\n [8, 3.5, \"fisheye\", { distortion: 0.5, astigmatism: 1.5, fieldCurvature: 1.5, lateralColor: 2, vignetting: 0.8, strayLight: 1.5, breathing: 0.3, closeFocus: 0.5 },\n \"Circular fisheye: astigmatism, field curvature and lateral colour grow towards the image circle; the exposed front element flares more; little breathing at 8 mm. Its distortion is the small departure from the equisolid projection.\", \"Circular fisheye; softer toward the rim\", \"circular\"],\n [10, 3.2, \"standard\", { distortion: -2.5, astigmatism: 1.4, fieldCurvature: 1.3, lateralColor: 1.8, vignetting: 1.4, strayLight: 1.3 },\n \"Rectilinear ultra-wide: strong barrel distortion, softer corners, lateral colour and corner fall-off.\", \"Strong barrel distortion; softer corners\"],\n [15, 2.8, \"fisheye\", { distortion: 0.5, astigmatism: 1.4, fieldCurvature: 1.3, lateralColor: 1.8, vignetting: 0.9, strayLight: 1.5, breathing: 0.3, closeFocus: 0.5 },\n \"Full-frame fisheye: as the circular fisheye, with its image filling the frame.\", \"Full-frame fisheye; softer edges\", \"full-frame\"],\n [16, 1.8, \"standard\", { distortion: -1.8, coma: 1.4, astigmatism: 1.3, lateralColor: 1.5, vignetting: 1.5, strayLight: 1.2 },\n \"Fast ultra-wide: coma and corner fall-off wide open, barrel distortion.\", \"Fast ultra-wide; coma wide open\"],\n [20, 1.4, \"standard\", { distortion: -1.3, coma: 1.4, astigmatism: 1.2, lateralColor: 1.3, vignetting: 1.4 }, \"Fast wide angle: coma wide open, barrel distortion.\", \"Fast wide angle; coma wide open\"],\n [24, 1.4, \"standard\", { distortion: -1, coma: 1.3, astigmatism: 1.1, lateralColor: 1.2, vignetting: 1.3 }, \"Fast wide angle: some coma wide open.\", \"Fast wide angle; some coma wide open\"],\n [35, 1.2, \"standard\", { distortion: -0.6, spherical: 1.3, coma: 1.2, axialColor: 1.3, vignetting: 1.3 }, \"Very fast: spherical aberration and axial colour wide open.\", \"Very fast; axial color wide open\"],\n [50, 1.2, \"standard\", { distortion: -0.3, spherical: 1.3, axialColor: 1.3, vignetting: 1.2 }, \"Very fast normal lens: spherical aberration and axial colour wide open; nearly no distortion.\", \"Very fast; nearly no distortion\"],\n [85, 1.2, \"standard\", { distortion: 0.3, spherical: 1.2, axialColor: 1.4, coma: 0.8, astigmatism: 0.7, vignetting: 1.1 },\n \"Very fast short telephoto: axial colour wide open, a small field angle so less coma and astigmatism; slight pincushion.\", \"Even across the frame; axial color\"],\n [100, 2.8, \"macro\", { distortion: 0.1, spherical: 0.8, coma: 0.7, astigmatism: 0.7, fieldCurvature: 0.5, axialColor: 0.8, vignetting: 0.6, breathing: 1.5, closeFocus: 0.2 },\n \"Macro: a flat field and corrections optimised for close focus (to 1:1), but strong breathing.\", \"Flat field to 1:1; strong breathing\"],\n [200, 2, \"standard\", { distortion: 0.4, axialColor: 1.5, lateralColor: 0.8, coma: 0.6, astigmatism: 0.6, vignetting: 0.9 }, \"Fast long telephoto: axial colour; a small field angle.\", \"Fast telephoto; axial color wide open\"],\n [300, 2.8, \"standard\", { distortion: 0.4, axialColor: 1.4, coma: 0.5, astigmatism: 0.5, vignetting: 0.8 }, \"Long telephoto: axial colour; a small field angle.\", \"Long telephoto; axial color\"],\n [400, 2.8, \"standard\", { distortion: 0.4, axialColor: 1.5, coma: 0.5, astigmatism: 0.5, vignetting: 0.9 }, \"Fast super telephoto: axial colour.\", \"Fast super telephoto; axial color\"],\n [500, 4, \"standard\", { distortion: 0.3, axialColor: 1.2, coma: 0.5, astigmatism: 0.5, vignetting: 0.7 }, \"Super telephoto.\", \"Super telephoto; low coma\"],\n [600, 4, \"standard\", { distortion: 0.3, axialColor: 1.3, coma: 0.5, astigmatism: 0.5, vignetting: 0.8 }, \"Super telephoto.\", \"Super telephoto; low coma, axial color\"],\n [800, 5.6, \"standard\", { distortion: 0.3, axialColor: 1.2, coma: 0.5, astigmatism: 0.5, vignetting: 0.7 }, \"Super telephoto.\", \"Slow super telephoto; low coma\"],\n [1200, 8, \"standard\", { distortion: 0.2, axialColor: 1.1, coma: 0.5, astigmatism: 0.5, vignetting: 0.6 }, \"Slow extreme telephoto: little vignetting.\", \"Slow extreme telephoto; little falloff\"]\n];\nconst CONSUMER: readonly Row[] = [\n [16, 2.8, \"standard\", { distortion: -1.5, coma: 1.1, astigmatism: 1.2, fieldCurvature: 1.2, lateralColor: 1.3, vignetting: 1.2, strayLight: 1.2 },\n \"Ultra-wide: strong barrel distortion and soft corners, left to the correction profile.\", \"Strong barrel distortion; soft corners\"],\n [20, 2, \"standard\", { distortion: -1.2, coma: 1.15, astigmatism: 1.1, lateralColor: 1.2, vignetting: 1.15 }, \"Wide angle: barrel distortion, coma wide open.\", \"Barrel distortion; coma wide open\"],\n [24, 1.8, \"standard\", { distortion: -1, coma: 1.1, lateralColor: 1.1, vignetting: 1.1 }, \"Wide angle: barrel distortion.\", \"Barrel distortion; mild corner falloff\"],\n [35, 1.8, \"standard\", { distortion: -0.6 }, \"The consumer baseline.\", \"The consumer baseline; mild barrel\"],\n [50, 1.8, \"standard\", { distortion: -0.3, spherical: 0.7, coma: 0.7, astigmatism: 0.7, fieldCurvature: 0.7, axialColor: 0.8, lateralColor: 0.6, vignetting: 0.8 },\n \"A simple, well-corrected normal design: quite good for its set (owner's example).\", \"Simple, well-corrected normal lens\"],\n [85, 1.8, \"standard\", { distortion: 0.3, spherical: 0.9, axialColor: 1.1, coma: 0.8, astigmatism: 0.8 }, \"Short telephoto: axial colour wide open.\", \"Short telephoto; axial color wide open\"],\n [100, 2, \"standard\", { distortion: 0.4, axialColor: 1.2, coma: 0.85 }, \"Short telephoto: axial colour wide open.\", \"Short telephoto; axial color, pincushion\"],\n [200, 5.6, \"standard\", { distortion: 0.6, axialColor: 0.9, lateralColor: 1.2, coma: 0.8, astigmatism: 0.9, vignetting: 0.8 }, \"Slow telephoto: lateral colour, pincushion.\", \"Lateral color and pincushion\"],\n [300, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.3 }, \"Slow telephoto: lateral colour, pincushion.\", \"Lateral color and pincushion\"],\n [400, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.3, axialColor: 1.1 }, \"Slow super telephoto: lateral and axial colour.\", \"Slow super telephoto; lateral color\"],\n [500, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.4, axialColor: 1.15, astigmatism: 1.1, fieldCurvature: 1.1 }, \"Slow super telephoto: softer edges.\", \"Slow super telephoto; softer edges\"],\n [600, 6.3, \"standard\", { distortion: 0.6, spherical: 1.2, coma: 1.2, astigmatism: 1.25, fieldCurvature: 1.25, lateralColor: 1.4, axialColor: 1.2, vignetting: 1.2 },\n \"Soft at the edges and wide open (owner's example).\", \"Soft at the edges and wide open\"],\n [800, 9, \"standard\", { distortion: 0.5, astigmatism: 1.15, fieldCurvature: 1.15, lateralColor: 1.4, axialColor: 1.1 }, \"Slow extreme telephoto: softer edges, lateral colour.\", \"Slow extreme telephoto; softer edges\"]\n];\n\nfunction entry(set: GenericLensSet, [focal, widest, kind, adjustments, note, summary, fisheye]: Row): GenericLensCatalogueEntry {\n const special = kind === \"macro\" ? \" Macro\" : kind === \"fisheye\" ? \" Fisheye\" : \"\";\n const suffix = set === \"professional\" ? \" Pro\" : \"\";\n return Object.freeze({ lensId: (\"pv-\" + focal + \"-\" + widest + special + suffix).toLowerCase().replace(/ /g, \"-\"), name: \"PV \" + focal + \" \" + widest + special + suffix,\n set, kind, equivalentFocalLengthMm: focal, widestFNumber: widest, narrowestFNumber: narrowest(focal),\n maximumMagnification: kind === \"macro\" ? 1 : GENERIC_PRIME_MINIMUM_FOCUS.magnification, projection: kind === \"fisheye\" ? \"fisheye-equisolid-angle\" as const : \"rectilinear\" as const,\n ...(fisheye ? { fisheyeImage: fisheye } : {}), adjustments: Object.freeze({ ...adjustments }), note, summary });\n}\n\n/** The 30 lenses: 17 professional, then 13 consumer, each set by focal length. */\nexport const GENERIC_LENS_CATALOGUE: readonly GenericLensCatalogueEntry[] = /* @__PURE__ */ Object.freeze([...PRO.map((row) => entry(\"professional\", row)),\n ...CONSUMER.map((row) => entry(\"consumer\", row))]);\n/** The catalogue ids, in catalogue order. */\nexport const GENERIC_LENS_IDS: readonly string[] = /* @__PURE__ */ Object.freeze(GENERIC_LENS_CATALOGUE.map((lens) => lens.lensId));\n\n/** Where the catalogue's numbers come from: Photivra's own choices, guided by openly published descriptions of lens behaviour. */\nexport const GENERIC_LENS_EVIDENCE: readonly EvidenceProvenance[] = /* @__PURE__ */ Object.freeze([\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"photivra\" as const, sourceReference: \"photivra:generic-lens-catalogue:549\", reuseStatus: \"photivra-owned\" as const,\n note: \"Coefficients chosen by Photivra (#549); not measured, not modelled on any product.\" }),\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"third-party\" as const, sourceReference: \"Wyant & Creath 1992, Basic Wavefront Aberration Theory for Optical Metrology, Applied Optics and Optical Engineering XI ch. 1 (free author copy)\",\n reuseStatus: \"factual-reference-only\" as const, note: \"Seidel wave-aberration expansion, pupil scaling and balanced spherical aberration; no data reproduced.\" }),\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"third-party\" as const, sourceReference: \"Wikipedia: Vignetting; Distortion (optics); Chromatic aberration; Coma (optics); Lens flare; Focus breathing\",\n reuseStatus: \"factual-reference-only\" as const, note: \"Qualitative descriptions of how these effects vary with lens class and aperture; no data reproduced.\" })\n]);\n\n/** Normalised Cauchy dispersion D(λ) = (1/λ² − 1/λ_d²)/(1/λ_F² − 1/λ_C²): 0 at the d line, F minus C = 1. */\nexport function genericLensDispersion(wavelengthNm: number): number {\n const inv = (nm: number): number => 1 / (nm * nm);\n return (inv(wavelengthNm) - inv(FRAUNHOFER_D_LINE_NM)) / (inv(FRAUNHOFER_F_LINE_NM) - inv(FRAUNHOFER_C_LINE_NM));\n}\n\n/** A catalogue lens's character resolved for a sensor, an f-number and a focus distance. Aberrations in waves at 550 nm. */\nexport interface GenericLensCharacter {\n fNumber: number;\n focusDistanceM: number | null;\n /** Thin-lens magnification at the focus distance (0 at infinity). */\n magnification: number;\n /** 1 + c·m/m_max. */\n closeFocusGain: number;\n /** Pupil-radius ratio N0/N. */\n pupilScale: number;\n /** Resolved Seidel coefficients at the frame corner (H = 1), waves at 550 nm; `balancingDefocusWaves` = −spherical. */\n aberrations: { sphericalWaves: number; balancingDefocusWaves: number; comaWaves: number; astigmatismWaves: number; fieldCurvatureWaves: number; axialColorWaves: number };\n /** Lateral colour: F-to-C image-radius difference at the corner, fraction of the half-diagonal and micrometres on this sensor. */\n lateralColor: { fraction: number; cornerMicrometers: number };\n /** Radial distortion profile (normalised to the half-diagonal, valid to 1.25 of it, beyond the corner) and its corner value (fraction; negative = barrel). */\n distortion: { profile: RadialDistortionProfile; corner: number };\n /** Relative illumination profile (normalised to the half-diagonal, valid to 1.25 of it) and the corner fall-off in stops. */\n vignetting: { profile: IlluminationVignettingProfile; cornerStops: number };\n strayLight: { veilingGlareFraction: number; ghostFraction: number };\n /** Field-of-view change at this focus and at minimum focus, beyond thin-lens unit focusing (fraction, negative = narrower). */\n breathing: { fieldOfViewChange: number; atMinimumFocus: number };\n /** Standard deviation of the autofocus error as a fraction of the depth of focus 2·N·c. */\n focusScatterDepthOfFocusFraction: number;\n /**\n * Bokeh character (#567) at this f-number, focus and sensor, as the options of `lens.defocus` and `calculateDefocusBokehKernel`\n * (#553): blades, the resolved W040 as `sphericalAberration` (µm at this f-number) and, for fast wides and normals, `catsEye`.\n */\n bokeh: DefocusBokehOptions;\n}\n\nexport interface ResolvedGenericLens {\n lensId: string;\n name: string;\n set: GenericLensSet;\n kind: GenericLensKind;\n equivalentFocalLengthMm: number;\n /** Physical focal length on this sensor: equivalent ÷ crop factor. */\n focalLengthMm: number;\n cropFactor35Mm: number;\n /** Half-diagonal of the sensor, mm: field height H = 1 and ρ = 1 of the profiles. */\n halfDiagonalMm: number;\n widestFNumber: number;\n narrowestFNumber: number;\n /** Marked third-stop f-numbers within the range. */\n fNumbers: readonly number[];\n /** max(0.10 m, f·(1 + 1/m_max)), metres from the lens (thin lens). */\n minimumFocusDistanceM: number;\n maximumMagnification: number;\n projection: LensProjectionModel;\n fisheyeImage: \"circular\" | \"full-frame\" | null;\n /** Fisheyes: the radius of the 180° image circle on this sensor, 2·f·sin 45° (equisolid), mm. Null otherwise. */\n imageCircleRadiusMm: number | null;\n character: GenericLensCharacter;\n note: string;\n /** The catalogue entry's `summary`: a short plain-English description of the lens's character (at most 40 characters). */\n summary: string;\n evidence: readonly EvidenceProvenance[];\n scientificStatus: \"approximation\";\n limitations: readonly string[];\n}\n\nexport interface ResolveGenericLensInput {\n /** A catalogue id (`GENERIC_LENS_IDS`). */\n lensId: string;\n /** The sensor's active capture area, mm. */\n activeImagingArea: { widthMm: number; heightMm: number };\n /** Default: the widest aperture. Must lie in the lens's range. */\n fNumber?: number;\n /** Default: infinity. At least the minimum focus distance. */\n focusDistanceM?: number;\n}\n\n/** @internal The catalogue entry of an id, or a domain error naming the ids. */\nexport function genericLensEntry(lensId: unknown): GenericLensCatalogueEntry {\n const found = typeof lensId === \"string\" ? GENERIC_LENS_CATALOGUE.find((lens) => lens.lensId === lensId) : undefined;\n if (!found) throw new InvalidConfigurationError(\"lensId must be a generic lens catalogue id (GENERIC_LENS_IDS), for example \\\"pv-50-1.2-pro\\\" or \\\"pv-50-1.8\\\".\");\n return found;\n}\n\n/** @internal The baseline with the lens's adjustments applied (at its widest aperture, infinity focus). */\nexport function genericLensAdjustedValues(lens: GenericLensCatalogueEntry): GenericLensCharacterValues {\n const b = GENERIC_LENS_SET_BASELINES[lens.set], a = lens.adjustments, k = (key: keyof GenericLensAdjustments): number => a[key] ?? 1;\n return { sphericalWaves: b.sphericalWaves * k(\"spherical\"), comaWaves: b.comaWaves * k(\"coma\"), astigmatismWaves: b.astigmatismWaves * k(\"astigmatism\"),\n fieldCurvatureWaves: b.fieldCurvatureWaves * k(\"fieldCurvature\"), axialColorWaves: b.axialColorWaves * k(\"axialColor\"),\n lateralColorFraction: b.lateralColorFraction * k(\"lateralColor\"), distortionMagnitude: b.distortionMagnitude * a.distortion,\n naturalVignettingStops: b.naturalVignettingStops * k(\"vignetting\"), opticalVignettingStops: b.opticalVignettingStops * k(\"vignetting\"),\n veilingGlareFraction: b.veilingGlareFraction * k(\"strayLight\"), ghostFraction: b.ghostFraction * k(\"strayLight\"), breathingFraction: b.breathingFraction * k(\"breathing\"),\n focusScatterDepthOfFocusFraction: b.focusScatterDepthOfFocusFraction * k(\"focusScatter\"), closeFocusFactor: b.closeFocusFactor * k(\"closeFocus\") };\n}\n\n/** @internal E(ρ) = (1 − bρ²)² with E(1) = 2^−stops, valid to `maximumNormalizedRadius` (which must stay inside the first zero). */\nexport function genericLensVignettingProfile(cornerStops: number, halfDiagonalMm: number, maximumNormalizedRadius = 1): IlluminationVignettingProfile {\n const b = 1 - 2 ** (-cornerStops / 2);\n return { normalizationRadiusMm: halfDiagonalMm, maximumNormalizedRadius, coefficients: { r2: -2 * b, r4: b * b, r6: 0 } };\n}\n/** @internal r_d = r(1 + k1 ρ²) normalised to the half-diagonal. */\nexport function genericLensDistortionProfile(corner: number, halfDiagonalMm: number, maximumNormalizedRadius = 1): RadialDistortionProfile {\n return { normalizationRadiusMm: halfDiagonalMm, maximumNormalizedRadius, coefficients: { k1: corner, k2: 0, k3: 0 } };\n}\n\n/**\n * @internal How far the profiles `resolveGenericLens` returns reach, in units of the half-diagonal. A request that reads the scene\n * through them (`simulateCapture`, `simulateDisplayView`) needs them beyond the frame's corner: the outer site centres plus the\n * kernel radius and the query offsets. 1.25 covers a kernel reaching a quarter of the half-diagonal past the corner (on full\n * frame 5.4 mm, beyond the 512-site disc at 6 µm). Every catalogue lens stays valid there: its vignetting E = (1 − bρ²)² keeps\n * bρ² ≤ 0.83 (b ≤ 0.53, the 2.16-stop corner of PV 16 2.8), and its distortion stays monotonic (1 + 3k1ρ² ≥ 0.75 at k1 = −0.045).\n * Only the operating range grows; the coefficients, and so every value inside the frame, are unchanged.\n */\nexport const GENERIC_LENS_RESOLVED_PROFILE_REACH = 1.25;\n/** The distortion profile's range for that reach: with barrel distortion an image point at ρ_d comes from ρ_d/(1 + k1ρ²), farther out. */\nfunction resolvedDistortionReach(k1: number): number {\n const r = GENERIC_LENS_RESOLVED_PROFILE_REACH;\n return k1 < 0 ? r / (1 + k1 * r * r) * 1.01 : r;\n}\n\n/**\n * The centre shift d (pupil radii) of a clipping circle of the pupil's radius that leaves the open fraction `open` of the pupil:\n * the lens of two unit circles, (2/π)(acos(d/2) − (d/2)·√(1 − d²/4)) = open, by bisection (acos u = π/2 − asin u, portable).\n */\nfunction catsEyeShift(open: number): number {\n let low = 0, high = 2;\n for (let k = 0; k < 52; k++) {\n const d = (low + high) / 2, u = d / 2;\n if ((Math.PI / 2 - portableAsin(u) - u * Math.sqrt(1 - u * u)) * 2 / Math.PI > open) low = d; else high = d;\n }\n return (low + high) / 2;\n}\n\nfunction positiveFinite(value: unknown, name: string): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) throw new InvalidScientificInputError(name + \" must be a positive finite number.\");\n return value;\n}\n\n/**\n * Resolves a catalogue lens for a sensor: its focal length (equivalent ÷ the diagonal crop factor), f-number range, close focus\n * and projection, and its character (aberrations, colour, distortion, vignetting, flare, breathing and focus scatter) at the\n * given f-number and focus distance. Every value is a labelled approximation of a generic lens, not a measured product.\n */\nexport function resolveGenericLens(input: ResolveGenericLensInput): ResolvedGenericLens {\n requireInputObject(input, \"resolveGenericLens input\");\n requireInputKeys(input, \"resolveGenericLens\", [\"lensId\", \"activeImagingArea\", \"fNumber\", \"focusDistanceM\"]);\n const lens = genericLensEntry(input.lensId);\n requireInputObject(input.activeImagingArea, \"activeImagingArea\");\n const widthMm = positiveFinite(input.activeImagingArea.widthMm, \"activeImagingArea.widthMm\"), heightMm = positiveFinite(input.activeImagingArea.heightMm, \"activeImagingArea.heightMm\");\n const crop = calculateEquivalentFocalLength35Mm({ focalLengthMm: 1, activeImagingArea: { widthMm, heightMm } }).value.cropFactor35Mm;\n const focalLengthMm = lens.equivalentFocalLengthMm / crop, f = focalLengthMm / 1000, halfDiagonalMm = Math.hypot(widthMm, heightMm) / 2;\n const minimumFocusDistanceM = Math.max(GENERIC_PRIME_MINIMUM_FOCUS.minimumDistanceM, f * (1 + 1 / lens.maximumMagnification));\n const fNumber = input.fNumber === undefined ? lens.widestFNumber : positiveFinite(input.fNumber, \"fNumber\");\n if (fNumber < lens.widestFNumber || fNumber > lens.narrowestFNumber)\n throw new InvalidScientificInputError(\"fNumber \" + fNumber + \" is outside the \" + lens.name + \" range f/\" + lens.widestFNumber + \"–f/\" + lens.narrowestFNumber + \".\");\n const focusDistanceM = input.focusDistanceM === undefined ? null : positiveFinite(input.focusDistanceM, \"focusDistanceM\");\n if (focusDistanceM !== null && focusDistanceM < minimumFocusDistanceM)\n throw new InvalidScientificInputError(\"focusDistanceM \" + focusDistanceM + \" m is closer than the \" + lens.name + \" minimum focus distance \" + minimumFocusDistanceM + \" m.\");\n const values = genericLensAdjustedValues(lens), maximumMagnification = f / (minimumFocusDistanceM - f);\n const magnification = focusDistanceM === null ? 0 : f / (focusDistanceM - f), closeness = Math.min(1, magnification / maximumMagnification);\n const closeFocusGain = 1 + values.closeFocusFactor * closeness, a = lens.widestFNumber / fNumber;\n const cornerStops = values.naturalVignettingStops + values.opticalVignettingStops * Math.min(1, Math.max(0, 1 - Math.log2(fNumber / lens.widestFNumber) / 2));\n // #567: the cat's eye of the fast (≤ f/2) rectilinear wides and normals (≤ 50 mm), resolved on this sensor (see the module comment).\n const pro = lens.set === \"professional\", pupilMm = focalLengthMm / lens.widestFNumber / 2;\n const bokeh: DefocusBokehOptions = { blades: { count: pro ? 9 : 7, firstBladeEdgeAngleDegrees: 0, curvature: pro ? 0.7 : 0.3, circularAtOrBelowFNumber: lens.widestFNumber },\n sphericalAberration: { w040Micrometers: values.sphericalWaves * a ** 4 * closeFocusGain * 0.55, atFNumber: fNumber },\n ...(lens.kind === \"standard\" && lens.equivalentFocalLengthMm <= 50 && lens.widestFNumber <= 2 ? { catsEye: { apertures: [{ radiusMm: pupilMm,\n shiftPerTanFieldMm: catsEyeShift(2 ** -values.opticalVignettingStops) * pupilMm * focalLengthMm / halfDiagonalMm }] } } : {}) };\n const character: GenericLensCharacter = { fNumber, focusDistanceM, magnification, closeFocusGain, pupilScale: a,\n aberrations: { sphericalWaves: values.sphericalWaves * a ** 4 * closeFocusGain, balancingDefocusWaves: -values.sphericalWaves * a ** 4 * closeFocusGain,\n comaWaves: values.comaWaves * a ** 3 * closeFocusGain, astigmatismWaves: values.astigmatismWaves * a * a * closeFocusGain,\n fieldCurvatureWaves: values.fieldCurvatureWaves * a * a * closeFocusGain, axialColorWaves: values.axialColorWaves * a * a * closeFocusGain },\n lateralColor: { fraction: values.lateralColorFraction, cornerMicrometers: values.lateralColorFraction * halfDiagonalMm * 1000 },\n distortion: { profile: genericLensDistortionProfile(values.distortionMagnitude, halfDiagonalMm, resolvedDistortionReach(values.distortionMagnitude)), corner: values.distortionMagnitude },\n vignetting: { profile: genericLensVignettingProfile(cornerStops, halfDiagonalMm, GENERIC_LENS_RESOLVED_PROFILE_REACH), cornerStops },\n strayLight: { veilingGlareFraction: values.veilingGlareFraction, ghostFraction: values.ghostFraction },\n breathing: { fieldOfViewChange: values.breathingFraction * closeness, atMinimumFocus: values.breathingFraction },\n focusScatterDepthOfFocusFraction: values.focusScatterDepthOfFocusFraction, bokeh };\n const fisheye = lens.kind === \"fisheye\";\n return Object.freeze({ lensId: lens.lensId, name: lens.name, set: lens.set, kind: lens.kind, equivalentFocalLengthMm: lens.equivalentFocalLengthMm, focalLengthMm,\n cropFactor35Mm: crop, halfDiagonalMm, widestFNumber: lens.widestFNumber, narrowestFNumber: lens.narrowestFNumber,\n fNumbers: Object.freeze(GENERIC_PRIME_THIRD_STOP_F_NUMBERS.filter((n) => n >= lens.widestFNumber && n <= lens.narrowestFNumber)),\n minimumFocusDistanceM, maximumMagnification, projection: lens.projection, fisheyeImage: lens.fisheyeImage ?? null,\n imageCircleRadiusMm: fisheye ? 2 * focalLengthMm * Math.SQRT1_2 : null, character, note: lens.note, summary: lens.summary, evidence: GENERIC_LENS_EVIDENCE,\n scientificStatus: \"approximation\" as const, limitations: Object.freeze([\n \"A generic Photivra lens, not a real product: every coefficient is a Photivra choice that reproduces typical behaviour of its class, not a measurement.\",\n \"Primary (Seidel) aberrations only, scaled with the pupil radius and a generic close-focus factor; no higher-order terms, no zoom or focus-group design.\",\n \"Focal length, close focus and magnification are thin-lens values; the lens design is scaled to the sensor by the crop factor with its wavefront error in waves kept.\",\n \"Flare, focus breathing and focus scatter are reported numbers; simulateCapture renders none of them.\"]) });\n}\n\nexport interface SimulateGenericLensFocusErrorInput {\n lensId: string;\n activeImagingArea: { widthMm: number; heightMm: number };\n fNumber: number;\n /** The intended focus distance, m. */\n focusDistanceM: number;\n /** uint32 seed of the shooting session. */\n seed: number;\n /** uint32 index of the shot in the session. Default 0. */\n shotIndex?: number;\n /** Circle of confusion for the depth of focus, mm. Default: the sensor diagonal / 1500. */\n circleOfConfusionMm?: number;\n}\n\nexport interface GenericLensFocusError {\n lensId: string;\n /** The intended and the sampled focus distance, m (the sampled one held within minimum focus and a far limit). */\n intendedFocusDistanceM: number;\n focusDistanceM: number;\n /** The standard normal draw z and the image-side focus error z·σ·2Nc, µm (positive: a longer image distance, so focused nearer). */\n standardNormal: number;\n imageSideErrorMicrometers: number;\n /** σ (fraction of the depth of focus) and the depth of focus 2·N·c, µm. */\n depthOfFocusFraction: number;\n depthOfFocusMicrometers: number;\n /** True when the sampled image distance was held at the minimum-focus or the far (1000 m) limit. */\n held: \"minimum-focus\" | \"far-limit\" | null;\n scientificStatus: \"approximation\";\n}\n\n/** Stream id of the focus-scatter draw (\"FOCS\"), kept apart from the sensor noise streams 0 and 1. */\nconst FOCUS_SCATTER_STREAM_ID = 0x464f4353;\n/** The far limit of a sampled focus distance, m. */\nconst FOCUS_SCATTER_FAR_LIMIT_M = 1000;\n\nfunction uint32(value: unknown, name: string): number {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value < 0 || value > 0xffffffff) throw new InvalidScientificInputError(name + \" must be a uint32 integer.\");\n return value;\n}\n\n/**\n * Focus consistency (#549): a seeded, reproducible autofocus error for one shot. The image-side error is z·σ·2Nc, with z a\n * standard normal draw from (seed, shotIndex) (MurmurHash3 stream seed, xorshift32 and Box–Muller, the generators of the\n * capture's sensor noise), σ the lens's focus scatter as a fraction of the depth of focus 2·N·c, and\n * c the circle of confusion. The thin-lens image distance of the intended focus moves by that error and the focus distance is\n * read back from it. An approximation of autofocus variation; off unless called (or `simulateCapture`'s `lens.focusScatter`).\n */\nexport function simulateGenericLensFocusError(input: SimulateGenericLensFocusErrorInput): GenericLensFocusError {\n requireInputObject(input, \"simulateGenericLensFocusError input\");\n requireInputKeys(input, \"simulateGenericLensFocusError\", [\"lensId\", \"activeImagingArea\", \"fNumber\", \"focusDistanceM\", \"seed\", \"shotIndex\", \"circleOfConfusionMm\"]);\n const lens = resolveGenericLens({ lensId: input.lensId, activeImagingArea: input.activeImagingArea, fNumber: input.fNumber, focusDistanceM: input.focusDistanceM });\n const seed = uint32(input.seed, \"seed\"), shot = input.shotIndex === undefined ? 0 : uint32(input.shotIndex, \"shotIndex\");\n const c = input.circleOfConfusionMm === undefined ? 2 * lens.halfDiagonalMm / 1500 : positiveFinite(input.circleOfConfusionMm, \"circleOfConfusionMm\");\n const z = sampleDeterministicStandardNormal(createDeterministicUniformStream(deriveNativeSiteStreamSeedUint32(seed, shot, FOCUS_SCATTER_STREAM_ID)));\n const sigma = lens.character.focusScatterDepthOfFocusFraction, depthOfFocusMm = 2 * lens.character.fNumber * c, errorMm = z * sigma * depthOfFocusMm;\n const f = lens.focalLengthMm, imageDistance = (d: number): number => 1 / (1 / f - 1 / (d * 1000));\n const nearest = imageDistance(lens.minimumFocusDistanceM), farthest = imageDistance(FOCUS_SCATTER_FAR_LIMIT_M);\n const v = imageDistance(input.focusDistanceM) + errorMm, held = v > nearest ? \"minimum-focus\" as const : v < farthest ? \"far-limit\" as const : null;\n const vHeld = Math.min(nearest, Math.max(farthest, v));\n const focusDistanceM = held === \"minimum-focus\" ? lens.minimumFocusDistanceM : held === \"far-limit\" ? FOCUS_SCATTER_FAR_LIMIT_M : 1 / (1 / f - 1 / vHeld) / 1000;\n return Object.freeze({ lensId: lens.lensId, intendedFocusDistanceM: input.focusDistanceM, focusDistanceM, standardNormal: z, imageSideErrorMicrometers: errorMm * 1000,\n depthOfFocusFraction: sigma, depthOfFocusMicrometers: depthOfFocusMm * 1000, held, scientificStatus: \"approximation\" as const });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"generic-lens-catalogue.js","sourceRoot":"","sources":["../../src/equipment/generic-lens-catalogue.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE1F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAIlI,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAA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pJ,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;IACjK,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,CAAC,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,EAAE,yBAAyB,EAAE,OAAO,GAAG,IAAI;QACpK,oBAAoB,EAAE,KAAK,EAAE,uBAAuB,EAAE,cAAc,GAAG,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,eAAwB,EAAE,CAAC,CAAC;AACrI,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Generic lens catalogue (#549): two sets of primes, Professional and Consumer, named \"PV <focal length> <maximum aperture>\"\n * (\"Pro\" for the professional set, \"Macro\" or \"Fisheye\" before it for special lenses). Every lens is Photivra's own generic\n * design, not modelled on any manufacturer's product, and every number in this file is a labelled approximation chosen by\n * Photivra to reproduce the typical behaviour that openly published optics texts describe for each class of lens. No\n * measured, branded or paid lens data is used.\n *\n * The data here are the lens definitions and their character as numbers (a set baseline and per-lens adjustments); the\n * PSF built from them lives in `optics/generic-lens-psf.ts`, so other models (for example bokeh, #553) can read the same\n * data. Each lens's numbers are resolved for a sensor (focal lengths scale by the crop factor as for `lens.prime`), an\n * f-number and a focus distance by {@link resolveGenericLens}.\n *\n * Models (each an approximation):\n * - Primary (Seidel) wave aberrations at the lens's widest aperture and at the frame corner (normalised field H = 1):\n * spherical W040, coma W131, astigmatism W222 and field curvature W220, in waves at 550 nm (Hopkins 1950; Wyant & Creath\n * 1992, Applied Optics and Optical Engineering XI ch. 1, free author copy). Stopping down from N0 to N scales the pupil\n * radius by a = N0/N and so each term W_klm·ρ^l by a^l (a⁴, a³, a², a²). Spherical aberration is balanced by defocus\n * W020 = −W040, the focus of minimum RMS wavefront error (Wyant & Creath 1992, sec. on balanced aberrations).\n * - Close focus: every aberration is multiplied by 1 + c·m/m_max, where m is the thin-lens magnification at the focus\n * distance and c the lens's close-focus factor (a generic stand-in for the change of aberrations with conjugate).\n * - Axial (longitudinal) colour: an extra defocus W020(λ) = W_ax·a²·D(λ), and lateral colour: a radial image displacement\n * Δr(λ) = L·R·H·D(λ) (R the frame's half-diagonal), both with the normalised Cauchy dispersion\n * D(λ) = (1/λ² − 1/λ_d²)/(1/λ_F² − 1/λ_C²) (Fraunhofer d, F and C lines; `calculateCauchyRefractiveIndex`).\n * - Distortion: radial r_d = r·(1 + k1·ρ²), ρ normalised to the frame's half-diagonal, so k1 is the corner distortion.\n * - Vignetting: relative illumination E(ρ) = (1 − b·ρ²)² with E(1) = 2^−s, s the corner fall-off in stops: a natural part,\n * plus an optical part that fades over the first four stops of stopping down (log2(N/N0) = 2 is four stops, since a\n * stop is a factor √2 in N).\n * - Bokeh (#567), the options of `lens.defocus` (#553) that `simulateCapture` folds into the PSF with `lens.defocus`: rounded\n * aperture blades (9 at curvature 0.7 for the professional set, 7 at 0.3 for the consumer set, open to a circle at the widest\n * aperture), the lens's own W040 as `sphericalAberration`, and, for the fast (f/2 or faster) rectilinear wides and normals\n * (at most 50 mm equivalent), a cat's eye: one clipping circle of the widest pupil's radius whose shift leaves the open area\n * 2^−s_o of the pupil at the frame corner wide open, s_o the lens's optical vignetting in stops (the light it removes is the\n * optical part of the relative illumination above; the kernel is a shape only).\n * - Flare, focus breathing and focus consistency are numbers for callers; `simulateCapture` renders none of them.\n * @see docs/LENS_CATALOGUE.md for the tables, the adjustments and why each lens has them.\n */\n\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport { requireInputKeys, requireInputObject } from \"../core/record-validation.js\";\nimport type { EvidenceProvenance } from \"../core/evidence-provenance.js\";\nimport { calculateEquivalentFocalLength35Mm } from \"../camera/equivalent-focal-length.js\";\nimport type { LensProjectionModel } from \"../camera/lens-projection.js\";\nimport { FRAUNHOFER_C_LINE_NM, FRAUNHOFER_D_LINE_NM, FRAUNHOFER_F_LINE_NM } from \"../optics/longitudinal-chromatic-aberration.js\";\nimport type { RadialDistortionProfile } from \"../optics/radial-distortion.js\";\nimport type { IlluminationVignettingProfile } from \"../optics/illumination-vignetting.js\";\nimport type { DefocusBokehOptions } from \"../optics/defocus-bokeh-kernel.js\";\nimport { portableAsin } from \"../core/portable-math.js\";\nimport { GENERIC_PRIME_MINIMUM_FOCUS, GENERIC_PRIME_THIRD_STOP_F_NUMBERS } from \"./generic-prime-lenses.js\";\nimport { createDeterministicUniformStream, deriveNativeSiteStreamSeedUint32, sampleDeterministicStandardNormal } from \"../sensor/stochastic-seed.js\";\n\n/** #554: \"phone\", the three fixed lenses of a phone sensor profile (`sensor.profile` with `fixedLenses: \"phone\"`). */\nexport type GenericLensSet = \"professional\" | \"consumer\" | \"phone\";\nexport type GenericLensKind = \"standard\" | \"macro\" | \"fisheye\";\n\n/** The character of a set, at each lens's widest aperture. Aberrations are in waves at 550 nm at the frame corner. */\nexport interface GenericLensCharacterValues {\n /** Spherical aberration W040 (balanced by W020 = −W040): centre sharpness. */\n sphericalWaves: number;\n /** Coma W131 at H = 1: the comet-shaped point images of night photography. */\n comaWaves: number;\n /** Astigmatism W222 at H = 1: edge and corner sharpness. */\n astigmatismWaves: number;\n /** Field curvature W220 at H = 1: edge and corner sharpness. */\n fieldCurvatureWaves: number;\n /** Axial colour: the F-to-C difference of the defocus W020, waves at 550 nm. */\n axialColorWaves: number;\n /** Lateral colour: the F-to-C difference of the image radius at the corner, as a fraction of the half-diagonal. */\n lateralColorFraction: number;\n /** Corner distortion magnitude |k1| (fraction); each lens gives the sign (barrel −, pincushion +). */\n distortionMagnitude: number;\n /** Corner fall-off in stops that stays when stopped down (natural vignetting). */\n naturalVignettingStops: number;\n /** Extra corner fall-off in stops at the widest aperture (optical vignetting); gone four stops down (N = 4·N0). */\n opticalVignettingStops: number;\n /** Veiling glare: the fraction of the image's mean irradiance spread as a uniform veil. */\n veilingGlareFraction: number;\n /** Peak ghost power as a fraction of a bright source's power on the axis. */\n ghostFraction: number;\n /** Field-of-view change between infinity and minimum focus as a fraction (negative: narrower), beyond thin-lens unit focusing. */\n breathingFraction: number;\n /** Standard deviation of the autofocus error as a fraction of the depth of focus 2·N·c. */\n focusScatterDepthOfFocusFraction: number;\n /** c in the close-focus factor 1 + c·m/m_max. */\n closeFocusFactor: number;\n}\n\n/** Per-lens multipliers of the set baseline (missing: 1). `distortion` is signed and required: −1 barrel, +1 pincushion at the baseline. */\nexport type GenericLensAdjustments = { distortion: number } & Partial<Record<\"spherical\" | \"coma\" | \"astigmatism\" | \"fieldCurvature\" | \"axialColor\" | \"lateralColor\" |\n \"vignetting\" | \"strayLight\" | \"breathing\" | \"focusScatter\" | \"closeFocus\", number>>;\n\nexport interface GenericLensCatalogueEntry {\n /** Catalogue id, for example \"pv-50-1.2-pro\". */\n lensId: string;\n /** Display name, for example \"PV 50 1.2 Pro\". */\n name: string;\n set: GenericLensSet;\n kind: GenericLensKind;\n /** Full-frame-equivalent focal length (36 × 24 mm reference). */\n equivalentFocalLengthMm: number;\n widestFNumber: number;\n narrowestFNumber: number;\n /** Largest magnification: 0.15 (the generic rule) or 1 for the professional macro. */\n maximumMagnification: number;\n projection: LensProjectionModel;\n /** Fisheyes only: a circular image inside the frame, or one that fills it. */\n fisheyeImage?: \"circular\" | \"full-frame\";\n adjustments: Readonly<GenericLensAdjustments>;\n /** Why this lens departs from its set's baseline. */\n note: string;\n /**\n * A short plain-English summary of the lens's character (at most 40 characters, US spelling), written from its adjustments and\n * `note`, for lists and pickers. It describes the lens's sharpness, color, distortion and falloff, not its bokeh (the same rule for every lens of a set).\n */\n summary: string;\n}\n\n/** The set baselines (owner's table, #549), each lens's starting point before its adjustments. */\nexport const GENERIC_LENS_SET_BASELINES: Readonly<Record<GenericLensSet, Readonly<GenericLensCharacterValues>>> = /* @__PURE__ */ Object.freeze({\n professional: /* @__PURE__ */ Object.freeze({ sphericalWaves: 0.25, comaWaves: 0.35, astigmatismWaves: 0.3, fieldCurvatureWaves: 0.15, axialColorWaves: 0.15,\n lateralColorFraction: 0.00008, distortionMagnitude: 0.01, naturalVignettingStops: 0.4, opticalVignettingStops: 0.6, veilingGlareFraction: 0.005, ghostFraction: 0.002,\n breathingFraction: -0.03, focusScatterDepthOfFocusFraction: 0.1, closeFocusFactor: 0.15 }),\n consumer: /* @__PURE__ */ Object.freeze({ sphericalWaves: 0.5, comaWaves: 1.0, astigmatismWaves: 0.8, fieldCurvatureWaves: 0.45, axialColorWaves: 0.4,\n lateralColorFraction: 0.0003, distortionMagnitude: 0.03, naturalVignettingStops: 0.7, opticalVignettingStops: 1.1, veilingGlareFraction: 0.02, ghostFraction: 0.008,\n breathingFraction: -0.08, focusScatterDepthOfFocusFraction: 0.3, closeFocusFactor: 0.5 }),\n // #554: design values (docs/LENS_CATALOGUE.md, \"Phone lenses\"): the consumer baseline with the stronger fall-off, flare and distortion\n // (corrected in software on phones) of small fixed-aperture phone lenses, and no optical-vignetting change (the aperture is fixed).\n phone: /* @__PURE__ */ Object.freeze({ sphericalWaves: 0.5, comaWaves: 1.0, astigmatismWaves: 0.8, fieldCurvatureWaves: 0.5, axialColorWaves: 0.3,\n lateralColorFraction: 0.0004, distortionMagnitude: 0.03, naturalVignettingStops: 1.2, opticalVignettingStops: 0.5, veilingGlareFraction: 0.03, ghostFraction: 0.01,\n breathingFraction: -0.05, focusScatterDepthOfFocusFraction: 0.3, closeFocusFactor: 0.5 })\n});\n\n/** The generic smallest aperture of both sets: f/16 up to 16 mm, f/22 up to 135 mm, f/32 beyond (as `lens.prime`). */\nfunction narrowest(equivalent: number): number { return equivalent <= 16 ? 16 : equivalent <= 135 ? 22 : 32; }\n\ntype Row = [focal: number, widest: number, kind: GenericLensKind, adjustments: GenericLensAdjustments, note: string, summary: string, fisheye?: \"circular\" | \"full-frame\"];\nconst PRO: readonly Row[] = [\n [8, 3.5, \"fisheye\", { distortion: 0.5, astigmatism: 1.5, fieldCurvature: 1.5, lateralColor: 2, vignetting: 0.8, strayLight: 1.5, breathing: 0.3, closeFocus: 0.5 },\n \"Circular fisheye: astigmatism, field curvature and lateral colour grow towards the image circle; the exposed front element flares more; little breathing at 8 mm. Its distortion is the small departure from the equisolid projection.\", \"Circular fisheye; softer toward the rim\", \"circular\"],\n [10, 3.2, \"standard\", { distortion: -2.5, astigmatism: 1.4, fieldCurvature: 1.3, lateralColor: 1.8, vignetting: 1.4, strayLight: 1.3 },\n \"Rectilinear ultra-wide: strong barrel distortion, softer corners, lateral colour and corner fall-off.\", \"Strong barrel distortion; softer corners\"],\n [15, 2.8, \"fisheye\", { distortion: 0.5, astigmatism: 1.4, fieldCurvature: 1.3, lateralColor: 1.8, vignetting: 0.9, strayLight: 1.5, breathing: 0.3, closeFocus: 0.5 },\n \"Full-frame fisheye: as the circular fisheye, with its image filling the frame.\", \"Full-frame fisheye; softer edges\", \"full-frame\"],\n [16, 1.8, \"standard\", { distortion: -1.8, coma: 1.4, astigmatism: 1.3, lateralColor: 1.5, vignetting: 1.5, strayLight: 1.2 },\n \"Fast ultra-wide: coma and corner fall-off wide open, barrel distortion.\", \"Fast ultra-wide; coma wide open\"],\n [20, 1.4, \"standard\", { distortion: -1.3, coma: 1.4, astigmatism: 1.2, lateralColor: 1.3, vignetting: 1.4 }, \"Fast wide angle: coma wide open, barrel distortion.\", \"Fast wide angle; coma wide open\"],\n [24, 1.4, \"standard\", { distortion: -1, coma: 1.3, astigmatism: 1.1, lateralColor: 1.2, vignetting: 1.3 }, \"Fast wide angle: some coma wide open.\", \"Fast wide angle; some coma wide open\"],\n [35, 1.2, \"standard\", { distortion: -0.6, spherical: 1.3, coma: 1.2, axialColor: 1.3, vignetting: 1.3 }, \"Very fast: spherical aberration and axial colour wide open.\", \"Very fast; axial color wide open\"],\n [50, 1.2, \"standard\", { distortion: -0.3, spherical: 1.3, axialColor: 1.3, vignetting: 1.2 }, \"Very fast normal lens: spherical aberration and axial colour wide open; nearly no distortion.\", \"Very fast; nearly no distortion\"],\n [85, 1.2, \"standard\", { distortion: 0.3, spherical: 1.2, axialColor: 1.4, coma: 0.8, astigmatism: 0.7, vignetting: 1.1 },\n \"Very fast short telephoto: axial colour wide open, a small field angle so less coma and astigmatism; slight pincushion.\", \"Even across the frame; axial color\"],\n [100, 2.8, \"macro\", { distortion: 0.1, spherical: 0.8, coma: 0.7, astigmatism: 0.7, fieldCurvature: 0.5, axialColor: 0.8, vignetting: 0.6, breathing: 1.5, closeFocus: 0.2 },\n \"Macro: a flat field and corrections optimised for close focus (to 1:1), but strong breathing.\", \"Flat field to 1:1; strong breathing\"],\n [200, 2, \"standard\", { distortion: 0.4, axialColor: 1.5, lateralColor: 0.8, coma: 0.6, astigmatism: 0.6, vignetting: 0.9 }, \"Fast long telephoto: axial colour; a small field angle.\", \"Fast telephoto; axial color wide open\"],\n [300, 2.8, \"standard\", { distortion: 0.4, axialColor: 1.4, coma: 0.5, astigmatism: 0.5, vignetting: 0.8 }, \"Long telephoto: axial colour; a small field angle.\", \"Long telephoto; axial color\"],\n [400, 2.8, \"standard\", { distortion: 0.4, axialColor: 1.5, coma: 0.5, astigmatism: 0.5, vignetting: 0.9 }, \"Fast super telephoto: axial colour.\", \"Fast super telephoto; axial color\"],\n [500, 4, \"standard\", { distortion: 0.3, axialColor: 1.2, coma: 0.5, astigmatism: 0.5, vignetting: 0.7 }, \"Super telephoto.\", \"Super telephoto; low coma\"],\n [600, 4, \"standard\", { distortion: 0.3, axialColor: 1.3, coma: 0.5, astigmatism: 0.5, vignetting: 0.8 }, \"Super telephoto.\", \"Super telephoto; low coma, axial color\"],\n [800, 5.6, \"standard\", { distortion: 0.3, axialColor: 1.2, coma: 0.5, astigmatism: 0.5, vignetting: 0.7 }, \"Super telephoto.\", \"Slow super telephoto; low coma\"],\n [1200, 8, \"standard\", { distortion: 0.2, axialColor: 1.1, coma: 0.5, astigmatism: 0.5, vignetting: 0.6 }, \"Slow extreme telephoto: little vignetting.\", \"Slow extreme telephoto; little falloff\"]\n];\n// #554: the owner's phone lenses (13, 24 and 77 mm equivalents at f/2.2, f/1.8 and f/2.8, fixed apertures); adjustments are design values.\nconst PHONE: readonly Row[] = [\n [13, 2.2, \"standard\", { distortion: -1.5, astigmatism: 1.3, fieldCurvature: 1.3, lateralColor: 1.5, vignetting: 1.2, strayLight: 1.2 },\n \"Phone ultra-wide: strong barrel distortion, softer corners and lateral colour, left to the phone's software correction.\", \"Strong barrel distortion; soft corners\"],\n [24, 1.8, \"standard\", { distortion: -0.5 }, \"Phone main camera: the phone baseline.\", \"The phone baseline; mild barrel\"],\n [77, 2.8, \"standard\", { distortion: 0.4, coma: 0.7, astigmatism: 0.8, axialColor: 1.2, vignetting: 0.8 },\n \"Phone telephoto: a small field angle, so less coma and astigmatism; axial colour; slight pincushion.\", \"Telephoto; axial color, pincushion\"]\n];\nconst CONSUMER: readonly Row[] = [\n [16, 2.8, \"standard\", { distortion: -1.5, coma: 1.1, astigmatism: 1.2, fieldCurvature: 1.2, lateralColor: 1.3, vignetting: 1.2, strayLight: 1.2 },\n \"Ultra-wide: strong barrel distortion and soft corners, left to the correction profile.\", \"Strong barrel distortion; soft corners\"],\n [20, 2, \"standard\", { distortion: -1.2, coma: 1.15, astigmatism: 1.1, lateralColor: 1.2, vignetting: 1.15 }, \"Wide angle: barrel distortion, coma wide open.\", \"Barrel distortion; coma wide open\"],\n [24, 1.8, \"standard\", { distortion: -1, coma: 1.1, lateralColor: 1.1, vignetting: 1.1 }, \"Wide angle: barrel distortion.\", \"Barrel distortion; mild corner falloff\"],\n [35, 1.8, \"standard\", { distortion: -0.6 }, \"The consumer baseline.\", \"The consumer baseline; mild barrel\"],\n [50, 1.8, \"standard\", { distortion: -0.3, spherical: 0.7, coma: 0.7, astigmatism: 0.7, fieldCurvature: 0.7, axialColor: 0.8, lateralColor: 0.6, vignetting: 0.8 },\n \"A simple, well-corrected normal design: quite good for its set (owner's example).\", \"Simple, well-corrected normal lens\"],\n [85, 1.8, \"standard\", { distortion: 0.3, spherical: 0.9, axialColor: 1.1, coma: 0.8, astigmatism: 0.8 }, \"Short telephoto: axial colour wide open.\", \"Short telephoto; axial color wide open\"],\n [100, 2, \"standard\", { distortion: 0.4, axialColor: 1.2, coma: 0.85 }, \"Short telephoto: axial colour wide open.\", \"Short telephoto; axial color, pincushion\"],\n [200, 5.6, \"standard\", { distortion: 0.6, axialColor: 0.9, lateralColor: 1.2, coma: 0.8, astigmatism: 0.9, vignetting: 0.8 }, \"Slow telephoto: lateral colour, pincushion.\", \"Lateral color and pincushion\"],\n [300, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.3 }, \"Slow telephoto: lateral colour, pincushion.\", \"Lateral color and pincushion\"],\n [400, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.3, axialColor: 1.1 }, \"Slow super telephoto: lateral and axial colour.\", \"Slow super telephoto; lateral color\"],\n [500, 5.6, \"standard\", { distortion: 0.6, lateralColor: 1.4, axialColor: 1.15, astigmatism: 1.1, fieldCurvature: 1.1 }, \"Slow super telephoto: softer edges.\", \"Slow super telephoto; softer edges\"],\n [600, 6.3, \"standard\", { distortion: 0.6, spherical: 1.2, coma: 1.2, astigmatism: 1.25, fieldCurvature: 1.25, lateralColor: 1.4, axialColor: 1.2, vignetting: 1.2 },\n \"Soft at the edges and wide open (owner's example).\", \"Soft at the edges and wide open\"],\n [800, 9, \"standard\", { distortion: 0.5, astigmatism: 1.15, fieldCurvature: 1.15, lateralColor: 1.4, axialColor: 1.1 }, \"Slow extreme telephoto: softer edges, lateral colour.\", \"Slow extreme telephoto; softer edges\"]\n];\n\nfunction entry(set: GenericLensSet, [focal, widest, kind, adjustments, note, summary, fisheye]: Row): GenericLensCatalogueEntry {\n const special = kind === \"macro\" ? \" Macro\" : kind === \"fisheye\" ? \" Fisheye\" : \"\";\n const suffix = set === \"professional\" ? \" Pro\" : set === \"phone\" ? \" Phone\" : \"\";\n return Object.freeze({ lensId: (\"pv-\" + focal + \"-\" + widest + special + suffix).toLowerCase().replace(/ /g, \"-\"), name: \"PV \" + focal + \" \" + widest + special + suffix,\n set, kind, equivalentFocalLengthMm: focal, widestFNumber: widest, narrowestFNumber: set === \"phone\" ? widest : narrowest(focal),\n maximumMagnification: kind === \"macro\" ? 1 : GENERIC_PRIME_MINIMUM_FOCUS.magnification, projection: kind === \"fisheye\" ? \"fisheye-equisolid-angle\" as const : \"rectilinear\" as const,\n ...(fisheye ? { fisheyeImage: fisheye } : {}), adjustments: Object.freeze({ ...adjustments }), note, summary });\n}\n\n/** The 33 lenses: 17 professional, 13 consumer and (#554) 3 phone lenses, each set by focal length. */\nexport const GENERIC_LENS_CATALOGUE: readonly GenericLensCatalogueEntry[] = /* @__PURE__ */ Object.freeze([...PRO.map((row) => entry(\"professional\", row)),\n ...CONSUMER.map((row) => entry(\"consumer\", row)), ...PHONE.map((row) => entry(\"phone\", row))]);\n/** The catalogue ids, in catalogue order. */\nexport const GENERIC_LENS_IDS: readonly string[] = /* @__PURE__ */ Object.freeze(GENERIC_LENS_CATALOGUE.map((lens) => lens.lensId));\n\n/** Where the catalogue's numbers come from: Photivra's own choices, guided by openly published descriptions of lens behaviour. */\nexport const GENERIC_LENS_EVIDENCE: readonly EvidenceProvenance[] = /* @__PURE__ */ Object.freeze([\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"photivra\" as const, sourceReference: \"photivra:generic-lens-catalogue:549\", reuseStatus: \"photivra-owned\" as const,\n note: \"Coefficients chosen by Photivra (#549); not measured, not modelled on any product.\" }),\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"third-party\" as const, sourceReference: \"Wyant & Creath 1992, Basic Wavefront Aberration Theory for Optical Metrology, Applied Optics and Optical Engineering XI ch. 1 (free author copy)\",\n reuseStatus: \"factual-reference-only\" as const, note: \"Seidel wave-aberration expansion, pupil scaling and balanced spherical aberration; no data reproduced.\" }),\n /* @__PURE__ */ Object.freeze({ sourceOrigin: \"third-party\" as const, sourceReference: \"Wikipedia: Vignetting; Distortion (optics); Chromatic aberration; Coma (optics); Lens flare; Focus breathing\",\n reuseStatus: \"factual-reference-only\" as const, note: \"Qualitative descriptions of how these effects vary with lens class and aperture; no data reproduced.\" })\n]);\n\n/** Normalised Cauchy dispersion D(λ) = (1/λ² − 1/λ_d²)/(1/λ_F² − 1/λ_C²): 0 at the d line, F minus C = 1. */\nexport function genericLensDispersion(wavelengthNm: number): number {\n const inv = (nm: number): number => 1 / (nm * nm);\n return (inv(wavelengthNm) - inv(FRAUNHOFER_D_LINE_NM)) / (inv(FRAUNHOFER_F_LINE_NM) - inv(FRAUNHOFER_C_LINE_NM));\n}\n\n/** A catalogue lens's character resolved for a sensor, an f-number and a focus distance. Aberrations in waves at 550 nm. */\nexport interface GenericLensCharacter {\n fNumber: number;\n focusDistanceM: number | null;\n /** Thin-lens magnification at the focus distance (0 at infinity). */\n magnification: number;\n /** 1 + c·m/m_max. */\n closeFocusGain: number;\n /** Pupil-radius ratio N0/N. */\n pupilScale: number;\n /** Resolved Seidel coefficients at the frame corner (H = 1), waves at 550 nm; `balancingDefocusWaves` = −spherical. */\n aberrations: { sphericalWaves: number; balancingDefocusWaves: number; comaWaves: number; astigmatismWaves: number; fieldCurvatureWaves: number; axialColorWaves: number };\n /** Lateral colour: F-to-C image-radius difference at the corner, fraction of the half-diagonal and micrometres on this sensor. */\n lateralColor: { fraction: number; cornerMicrometers: number };\n /** Radial distortion profile (normalised to the half-diagonal, valid to 1.25 of it, beyond the corner) and its corner value (fraction; negative = barrel). */\n distortion: { profile: RadialDistortionProfile; corner: number };\n /** Relative illumination profile (normalised to the half-diagonal, valid to 1.25 of it) and the corner fall-off in stops. */\n vignetting: { profile: IlluminationVignettingProfile; cornerStops: number };\n strayLight: { veilingGlareFraction: number; ghostFraction: number };\n /** Field-of-view change at this focus and at minimum focus, beyond thin-lens unit focusing (fraction, negative = narrower). */\n breathing: { fieldOfViewChange: number; atMinimumFocus: number };\n /** Standard deviation of the autofocus error as a fraction of the depth of focus 2·N·c. */\n focusScatterDepthOfFocusFraction: number;\n /**\n * Bokeh character (#567) at this f-number, focus and sensor, as the options of `lens.defocus` and `calculateDefocusBokehKernel`\n * (#553): blades, the resolved W040 as `sphericalAberration` (µm at this f-number) and, for fast wides and normals, `catsEye`.\n */\n bokeh: DefocusBokehOptions;\n}\n\nexport interface ResolvedGenericLens {\n lensId: string;\n name: string;\n set: GenericLensSet;\n kind: GenericLensKind;\n equivalentFocalLengthMm: number;\n /** Physical focal length on this sensor: equivalent ÷ crop factor. */\n focalLengthMm: number;\n cropFactor35Mm: number;\n /** Half-diagonal of the sensor, mm: field height H = 1 and ρ = 1 of the profiles. */\n halfDiagonalMm: number;\n widestFNumber: number;\n narrowestFNumber: number;\n /** Marked third-stop f-numbers within the range. */\n fNumbers: readonly number[];\n /** max(0.10 m, f·(1 + 1/m_max)), metres from the lens (thin lens). */\n minimumFocusDistanceM: number;\n maximumMagnification: number;\n projection: LensProjectionModel;\n fisheyeImage: \"circular\" | \"full-frame\" | null;\n /** Fisheyes: the radius of the 180° image circle on this sensor, 2·f·sin 45° (equisolid), mm. Null otherwise. */\n imageCircleRadiusMm: number | null;\n character: GenericLensCharacter;\n note: string;\n /** The catalogue entry's `summary`: a short plain-English description of the lens's character (at most 40 characters). */\n summary: string;\n evidence: readonly EvidenceProvenance[];\n scientificStatus: \"approximation\";\n limitations: readonly string[];\n}\n\nexport interface ResolveGenericLensInput {\n /** A catalogue id (`GENERIC_LENS_IDS`). */\n lensId: string;\n /** The sensor's active capture area, mm. */\n activeImagingArea: { widthMm: number; heightMm: number };\n /** Default: the widest aperture. Must lie in the lens's range. */\n fNumber?: number;\n /** Default: infinity. At least the minimum focus distance. */\n focusDistanceM?: number;\n}\n\n/** @internal The catalogue entry of an id, or a domain error naming the ids. */\nexport function genericLensEntry(lensId: unknown): GenericLensCatalogueEntry {\n const found = typeof lensId === \"string\" ? GENERIC_LENS_CATALOGUE.find((lens) => lens.lensId === lensId) : undefined;\n if (!found) throw new InvalidConfigurationError(\"lensId must be a generic lens catalogue id (GENERIC_LENS_IDS), for example \\\"pv-50-1.2-pro\\\" or \\\"pv-50-1.8\\\".\");\n return found;\n}\n\n/** @internal The baseline with the lens's adjustments applied (at its widest aperture, infinity focus). */\nexport function genericLensAdjustedValues(lens: GenericLensCatalogueEntry): GenericLensCharacterValues {\n const b = GENERIC_LENS_SET_BASELINES[lens.set], a = lens.adjustments, k = (key: keyof GenericLensAdjustments): number => a[key] ?? 1;\n return { sphericalWaves: b.sphericalWaves * k(\"spherical\"), comaWaves: b.comaWaves * k(\"coma\"), astigmatismWaves: b.astigmatismWaves * k(\"astigmatism\"),\n fieldCurvatureWaves: b.fieldCurvatureWaves * k(\"fieldCurvature\"), axialColorWaves: b.axialColorWaves * k(\"axialColor\"),\n lateralColorFraction: b.lateralColorFraction * k(\"lateralColor\"), distortionMagnitude: b.distortionMagnitude * a.distortion,\n naturalVignettingStops: b.naturalVignettingStops * k(\"vignetting\"), opticalVignettingStops: b.opticalVignettingStops * k(\"vignetting\"),\n veilingGlareFraction: b.veilingGlareFraction * k(\"strayLight\"), ghostFraction: b.ghostFraction * k(\"strayLight\"), breathingFraction: b.breathingFraction * k(\"breathing\"),\n focusScatterDepthOfFocusFraction: b.focusScatterDepthOfFocusFraction * k(\"focusScatter\"), closeFocusFactor: b.closeFocusFactor * k(\"closeFocus\") };\n}\n\n/** @internal E(ρ) = (1 − bρ²)² with E(1) = 2^−stops, valid to `maximumNormalizedRadius` (which must stay inside the first zero). */\nexport function genericLensVignettingProfile(cornerStops: number, halfDiagonalMm: number, maximumNormalizedRadius = 1): IlluminationVignettingProfile {\n const b = 1 - 2 ** (-cornerStops / 2);\n return { normalizationRadiusMm: halfDiagonalMm, maximumNormalizedRadius, coefficients: { r2: -2 * b, r4: b * b, r6: 0 } };\n}\n/** @internal r_d = r(1 + k1 ρ²) normalised to the half-diagonal. */\nexport function genericLensDistortionProfile(corner: number, halfDiagonalMm: number, maximumNormalizedRadius = 1): RadialDistortionProfile {\n return { normalizationRadiusMm: halfDiagonalMm, maximumNormalizedRadius, coefficients: { k1: corner, k2: 0, k3: 0 } };\n}\n\n/**\n * @internal How far the profiles `resolveGenericLens` returns reach, in units of the half-diagonal. A request that reads the scene\n * through them (`simulateCapture`, `simulateDisplayView`) needs them beyond the frame's corner: the outer site centres plus the\n * kernel radius and the query offsets. 1.25 covers a kernel reaching a quarter of the half-diagonal past the corner (on full\n * frame 5.4 mm, beyond the 512-site disc at 6 µm). Every catalogue lens stays valid there: its vignetting E = (1 − bρ²)² keeps\n * bρ² ≤ 0.83 (b ≤ 0.53, the 2.16-stop corner of PV 16 2.8), and its distortion stays monotonic (1 + 3k1ρ² ≥ 0.75 at k1 = −0.045).\n * Only the operating range grows; the coefficients, and so every value inside the frame, are unchanged.\n */\nexport const GENERIC_LENS_RESOLVED_PROFILE_REACH = 1.25;\n/** The distortion profile's range for that reach: with barrel distortion an image point at ρ_d comes from ρ_d/(1 + k1ρ²), farther out. */\nfunction resolvedDistortionReach(k1: number): number {\n const r = GENERIC_LENS_RESOLVED_PROFILE_REACH;\n return k1 < 0 ? r / (1 + k1 * r * r) * 1.01 : r;\n}\n\n/**\n * The centre shift d (pupil radii) of a clipping circle of the pupil's radius that leaves the open fraction `open` of the pupil:\n * the lens of two unit circles, (2/π)(acos(d/2) − (d/2)·√(1 − d²/4)) = open, by bisection (acos u = π/2 − asin u, portable).\n */\nfunction catsEyeShift(open: number): number {\n let low = 0, high = 2;\n for (let k = 0; k < 52; k++) {\n const d = (low + high) / 2, u = d / 2;\n if ((Math.PI / 2 - portableAsin(u) - u * Math.sqrt(1 - u * u)) * 2 / Math.PI > open) low = d; else high = d;\n }\n return (low + high) / 2;\n}\n\nfunction positiveFinite(value: unknown, name: string): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) throw new InvalidScientificInputError(name + \" must be a positive finite number.\");\n return value;\n}\n\n/**\n * Resolves a catalogue lens for a sensor: its focal length (equivalent ÷ the diagonal crop factor), f-number range, close focus\n * and projection, and its character (aberrations, colour, distortion, vignetting, flare, breathing and focus scatter) at the\n * given f-number and focus distance. Every value is a labelled approximation of a generic lens, not a measured product.\n */\nexport function resolveGenericLens(input: ResolveGenericLensInput): ResolvedGenericLens {\n requireInputObject(input, \"resolveGenericLens input\");\n requireInputKeys(input, \"resolveGenericLens\", [\"lensId\", \"activeImagingArea\", \"fNumber\", \"focusDistanceM\"]);\n const lens = genericLensEntry(input.lensId);\n requireInputObject(input.activeImagingArea, \"activeImagingArea\");\n const widthMm = positiveFinite(input.activeImagingArea.widthMm, \"activeImagingArea.widthMm\"), heightMm = positiveFinite(input.activeImagingArea.heightMm, \"activeImagingArea.heightMm\");\n const crop = calculateEquivalentFocalLength35Mm({ focalLengthMm: 1, activeImagingArea: { widthMm, heightMm } }).value.cropFactor35Mm;\n const focalLengthMm = lens.equivalentFocalLengthMm / crop, f = focalLengthMm / 1000, halfDiagonalMm = Math.hypot(widthMm, heightMm) / 2;\n const minimumFocusDistanceM = Math.max(GENERIC_PRIME_MINIMUM_FOCUS.minimumDistanceM, f * (1 + 1 / lens.maximumMagnification));\n const fNumber = input.fNumber === undefined ? lens.widestFNumber : positiveFinite(input.fNumber, \"fNumber\");\n if (fNumber < lens.widestFNumber || fNumber > lens.narrowestFNumber)\n throw new InvalidScientificInputError(\"fNumber \" + fNumber + \" is outside the \" + lens.name + \" range f/\" + lens.widestFNumber + \"–f/\" + lens.narrowestFNumber + \".\");\n const focusDistanceM = input.focusDistanceM === undefined ? null : positiveFinite(input.focusDistanceM, \"focusDistanceM\");\n if (focusDistanceM !== null && focusDistanceM < minimumFocusDistanceM)\n throw new InvalidScientificInputError(\"focusDistanceM \" + focusDistanceM + \" m is closer than the \" + lens.name + \" minimum focus distance \" + minimumFocusDistanceM + \" m.\");\n const values = genericLensAdjustedValues(lens), maximumMagnification = f / (minimumFocusDistanceM - f);\n const magnification = focusDistanceM === null ? 0 : f / (focusDistanceM - f), closeness = Math.min(1, magnification / maximumMagnification);\n const closeFocusGain = 1 + values.closeFocusFactor * closeness, a = lens.widestFNumber / fNumber;\n const cornerStops = values.naturalVignettingStops + values.opticalVignettingStops * Math.min(1, Math.max(0, 1 - Math.log2(fNumber / lens.widestFNumber) / 2));\n // #567: the cat's eye of the fast (≤ f/2) rectilinear wides and normals (≤ 50 mm), resolved on this sensor (see the module comment).\n const pro = lens.set === \"professional\", pupilMm = focalLengthMm / lens.widestFNumber / 2;\n const bokeh: DefocusBokehOptions = { blades: { count: pro ? 9 : 7, firstBladeEdgeAngleDegrees: 0, curvature: pro ? 0.7 : 0.3, circularAtOrBelowFNumber: lens.widestFNumber },\n sphericalAberration: { w040Micrometers: values.sphericalWaves * a ** 4 * closeFocusGain * 0.55, atFNumber: fNumber },\n ...(lens.kind === \"standard\" && lens.equivalentFocalLengthMm <= 50 && lens.widestFNumber <= 2 ? { catsEye: { apertures: [{ radiusMm: pupilMm,\n shiftPerTanFieldMm: catsEyeShift(2 ** -values.opticalVignettingStops) * pupilMm * focalLengthMm / halfDiagonalMm }] } } : {}) };\n const character: GenericLensCharacter = { fNumber, focusDistanceM, magnification, closeFocusGain, pupilScale: a,\n aberrations: { sphericalWaves: values.sphericalWaves * a ** 4 * closeFocusGain, balancingDefocusWaves: -values.sphericalWaves * a ** 4 * closeFocusGain,\n comaWaves: values.comaWaves * a ** 3 * closeFocusGain, astigmatismWaves: values.astigmatismWaves * a * a * closeFocusGain,\n fieldCurvatureWaves: values.fieldCurvatureWaves * a * a * closeFocusGain, axialColorWaves: values.axialColorWaves * a * a * closeFocusGain },\n lateralColor: { fraction: values.lateralColorFraction, cornerMicrometers: values.lateralColorFraction * halfDiagonalMm * 1000 },\n distortion: { profile: genericLensDistortionProfile(values.distortionMagnitude, halfDiagonalMm, resolvedDistortionReach(values.distortionMagnitude)), corner: values.distortionMagnitude },\n vignetting: { profile: genericLensVignettingProfile(cornerStops, halfDiagonalMm, GENERIC_LENS_RESOLVED_PROFILE_REACH), cornerStops },\n strayLight: { veilingGlareFraction: values.veilingGlareFraction, ghostFraction: values.ghostFraction },\n breathing: { fieldOfViewChange: values.breathingFraction * closeness, atMinimumFocus: values.breathingFraction },\n focusScatterDepthOfFocusFraction: values.focusScatterDepthOfFocusFraction, bokeh };\n const fisheye = lens.kind === \"fisheye\";\n return Object.freeze({ lensId: lens.lensId, name: lens.name, set: lens.set, kind: lens.kind, equivalentFocalLengthMm: lens.equivalentFocalLengthMm, focalLengthMm,\n cropFactor35Mm: crop, halfDiagonalMm, widestFNumber: lens.widestFNumber, narrowestFNumber: lens.narrowestFNumber,\n fNumbers: Object.freeze(GENERIC_PRIME_THIRD_STOP_F_NUMBERS.filter((n) => n >= lens.widestFNumber && n <= lens.narrowestFNumber)),\n minimumFocusDistanceM, maximumMagnification, projection: lens.projection, fisheyeImage: lens.fisheyeImage ?? null,\n imageCircleRadiusMm: fisheye ? 2 * focalLengthMm * Math.SQRT1_2 : null, character, note: lens.note, summary: lens.summary, evidence: GENERIC_LENS_EVIDENCE,\n scientificStatus: \"approximation\" as const, limitations: Object.freeze([\n \"A generic Photivra lens, not a real product: every coefficient is a Photivra choice that reproduces typical behaviour of its class, not a measurement.\",\n \"Primary (Seidel) aberrations only, scaled with the pupil radius and a generic close-focus factor; no higher-order terms, no zoom or focus-group design.\",\n \"Focal length, close focus and magnification are thin-lens values; the lens design is scaled to the sensor by the crop factor with its wavefront error in waves kept.\",\n \"Flare, focus breathing and focus scatter are reported numbers; simulateCapture renders none of them.\"]) });\n}\n\nexport interface SimulateGenericLensFocusErrorInput {\n lensId: string;\n activeImagingArea: { widthMm: number; heightMm: number };\n fNumber: number;\n /** The intended focus distance, m. */\n focusDistanceM: number;\n /** uint32 seed of the shooting session. */\n seed: number;\n /** uint32 index of the shot in the session. Default 0. */\n shotIndex?: number;\n /** Circle of confusion for the depth of focus, mm. Default: the sensor diagonal / 1500. */\n circleOfConfusionMm?: number;\n}\n\nexport interface GenericLensFocusError {\n lensId: string;\n /** The intended and the sampled focus distance, m (the sampled one held within minimum focus and a far limit). */\n intendedFocusDistanceM: number;\n focusDistanceM: number;\n /** The standard normal draw z and the image-side focus error z·σ·2Nc, µm (positive: a longer image distance, so focused nearer). */\n standardNormal: number;\n imageSideErrorMicrometers: number;\n /** σ (fraction of the depth of focus) and the depth of focus 2·N·c, µm. */\n depthOfFocusFraction: number;\n depthOfFocusMicrometers: number;\n /** True when the sampled image distance was held at the minimum-focus or the far (1000 m) limit. */\n held: \"minimum-focus\" | \"far-limit\" | null;\n scientificStatus: \"approximation\";\n}\n\n/** Stream id of the focus-scatter draw (\"FOCS\"), kept apart from the sensor noise streams 0 and 1. */\nconst FOCUS_SCATTER_STREAM_ID = 0x464f4353;\n/** The far limit of a sampled focus distance, m. */\nconst FOCUS_SCATTER_FAR_LIMIT_M = 1000;\n\nfunction uint32(value: unknown, name: string): number {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value < 0 || value > 0xffffffff) throw new InvalidScientificInputError(name + \" must be a uint32 integer.\");\n return value;\n}\n\n/**\n * Focus consistency (#549): a seeded, reproducible autofocus error for one shot. The image-side error is z·σ·2Nc, with z a\n * standard normal draw from (seed, shotIndex) (MurmurHash3 stream seed, xorshift32 and Box–Muller, the generators of the\n * capture's sensor noise), σ the lens's focus scatter as a fraction of the depth of focus 2·N·c, and\n * c the circle of confusion. The thin-lens image distance of the intended focus moves by that error and the focus distance is\n * read back from it. An approximation of autofocus variation; off unless called (or `simulateCapture`'s `lens.focusScatter`).\n */\nexport function simulateGenericLensFocusError(input: SimulateGenericLensFocusErrorInput): GenericLensFocusError {\n requireInputObject(input, \"simulateGenericLensFocusError input\");\n requireInputKeys(input, \"simulateGenericLensFocusError\", [\"lensId\", \"activeImagingArea\", \"fNumber\", \"focusDistanceM\", \"seed\", \"shotIndex\", \"circleOfConfusionMm\"]);\n const lens = resolveGenericLens({ lensId: input.lensId, activeImagingArea: input.activeImagingArea, fNumber: input.fNumber, focusDistanceM: input.focusDistanceM });\n const seed = uint32(input.seed, \"seed\"), shot = input.shotIndex === undefined ? 0 : uint32(input.shotIndex, \"shotIndex\");\n const c = input.circleOfConfusionMm === undefined ? 2 * lens.halfDiagonalMm / 1500 : positiveFinite(input.circleOfConfusionMm, \"circleOfConfusionMm\");\n const z = sampleDeterministicStandardNormal(createDeterministicUniformStream(deriveNativeSiteStreamSeedUint32(seed, shot, FOCUS_SCATTER_STREAM_ID)));\n const sigma = lens.character.focusScatterDepthOfFocusFraction, depthOfFocusMm = 2 * lens.character.fNumber * c, errorMm = z * sigma * depthOfFocusMm;\n const f = lens.focalLengthMm, imageDistance = (d: number): number => 1 / (1 / f - 1 / (d * 1000));\n const nearest = imageDistance(lens.minimumFocusDistanceM), farthest = imageDistance(FOCUS_SCATTER_FAR_LIMIT_M);\n const v = imageDistance(input.focusDistanceM) + errorMm, held = v > nearest ? \"minimum-focus\" as const : v < farthest ? \"far-limit\" as const : null;\n const vHeld = Math.min(nearest, Math.max(farthest, v));\n const focusDistanceM = held === \"minimum-focus\" ? lens.minimumFocusDistanceM : held === \"far-limit\" ? FOCUS_SCATTER_FAR_LIMIT_M : 1 / (1 / f - 1 / vHeld) / 1000;\n return Object.freeze({ lensId: lens.lensId, intendedFocusDistanceM: input.focusDistanceM, focusDistanceM, standardNormal: z, imageSideErrorMicrometers: errorMm * 1000,\n depthOfFocusFraction: sigma, depthOfFocusMicrometers: depthOfFocusMm * 1000, held, scientificStatus: \"approximation\" as const });\n}\n"]}
|
|
@@ -105,6 +105,38 @@ export declare const GENERIC_WHOLE_STOP_ISO_SETTINGS: readonly [100, 200, 400, 8
|
|
|
105
105
|
*/
|
|
106
106
|
export declare const GENERIC_THIRD_STOP_SHUTTER_SECONDS: readonly [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, 0.3, 0.4, 0.5, 0.6, 0.8, 1, 1.3, 1.6, 2, 2.5, 3.2, 4, 5, 6, 8, 10, 13, 15, 20, 25, 30];
|
|
107
107
|
export declare const GENERIC_THIRD_STOP_ISO_SETTINGS: readonly [100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, 10000, 12800, 16000, 20000, 25600];
|
|
108
|
+
/**
|
|
109
|
+
* Synthetic, educational sensor design values for each tier: ADC (analogue-to-digital converter),
|
|
110
|
+
* saturation signal Q0 at base ISO, analogue gain range, read noise for each conversion-gain mode,
|
|
111
|
+
* and fixed-pattern noise sizes. They are plausible orders of magnitude for consumer
|
|
112
|
+
* interchangeable-lens sensors. They are not data from any real camera.
|
|
113
|
+
*/
|
|
114
|
+
export interface SyntheticSensorDesign {
|
|
115
|
+
bitDepth: number;
|
|
116
|
+
blackLevelCode: number;
|
|
117
|
+
saturationElectrons: number;
|
|
118
|
+
maximumAnalogGain: number;
|
|
119
|
+
/** #554: a high gain from above the top ISO (or equal read noise) is one conversion gain, `single-conversion-gain`. */
|
|
120
|
+
lowGainReadNoise: number;
|
|
121
|
+
highGainReadNoise: number;
|
|
122
|
+
highGainFromIso: number;
|
|
123
|
+
highGainMaximumCharge: number;
|
|
124
|
+
prnu: number;
|
|
125
|
+
dsnu: number;
|
|
126
|
+
hotFraction: number;
|
|
127
|
+
hotMultiplier: number;
|
|
128
|
+
rowRms: number;
|
|
129
|
+
columnRms: number;
|
|
130
|
+
instanceSeed: number;
|
|
131
|
+
}
|
|
132
|
+
/** #554: a sensor profile's own ISO settings (base first) and provenance; the tiers use ISO 100 and their own. */
|
|
133
|
+
export interface GenericBodyAssetsSource {
|
|
134
|
+
isoValues: readonly number[];
|
|
135
|
+
evidence: readonly EvidenceProvenance[];
|
|
136
|
+
limitations: readonly string[];
|
|
137
|
+
}
|
|
138
|
+
/** Used only to build data. Tier labels never enter any scientific equation. */
|
|
139
|
+
export declare function bodyAssets(version: GenericTierPresetVersion, id: string, isoMax: number, cadence: number, frames: number, sensor: SyntheticSensorDesign, dataReadoutSeconds: number, gain: number, maxAngle: number, continuousAf: boolean, advancedPolicies: boolean, source?: GenericBodyAssetsSource): GenericTierBodyAssets;
|
|
108
140
|
/** The presets of the current version, 2.1.0 (third-stop ISO settings). */
|
|
109
141
|
export declare const GENERIC_TIER_ASSETS: readonly GenericEquipmentTierPreset[];
|
|
110
142
|
/** The presets of an exact version; 2.0.0 (whole-stop ISO) is built on first use. */
|
|
@@ -12,9 +12,10 @@ import { parseGenericBodyMeteringCapabilityProfile } from "./metering-capabiliti
|
|
|
12
12
|
import { parseFlashSyncCapabilityProfile } from "../exposure/flash.js";
|
|
13
13
|
import { createIsoGainReadoutRegimes } from "../sensor/iso-gain.js";
|
|
14
14
|
import { parseSensorFixedPatternNoiseProfile } from "../sensor/fixed-pattern-noise.js";
|
|
15
|
-
const
|
|
15
|
+
const tierEvidence = [{ sourceOrigin: "photivra", sourceReference: "photivra:generic-tier-assets-v1",
|
|
16
16
|
reuseStatus: "photivra-owned" }];
|
|
17
|
-
const
|
|
17
|
+
const tierLimitations = ["Synthetic educational design values; no named camera/lens calibration or population ranking."];
|
|
18
|
+
const evidence = tierEvidence, limitations = tierLimitations;
|
|
18
19
|
const fact = (value) => ({ value, evidence });
|
|
19
20
|
/** Whole-stop ISO settings of the 2.0.0 bodies (each body's list stops at its maximum). */
|
|
20
21
|
export const GENERIC_WHOLE_STOP_ISO_SETTINGS = /* @__PURE__ */ Object.freeze([100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600]);
|
|
@@ -41,21 +42,25 @@ const near = [0, 0, .12, 0, 0, 0, .06, 0, .06, 0, .12, 0, -.04, 0, .12, 0, .06,
|
|
|
41
42
|
const flat = Array(25).fill(0);
|
|
42
43
|
const far = near.map((v) => -v);
|
|
43
44
|
/** Used only to build data. Tier labels never enter any scientific equation. */
|
|
44
|
-
function bodyAssets(version, id, isoMax, cadence, frames, sensor, dataReadoutSeconds, gain, maxAngle, continuousAf, advancedPolicies) {
|
|
45
|
-
const
|
|
45
|
+
export function bodyAssets(version, id, isoMax, cadence, frames, sensor, dataReadoutSeconds, gain, maxAngle, continuousAf, advancedPolicies, source) {
|
|
46
|
+
const evidence = source?.evidence ?? tierEvidence, limitations = source?.limitations ?? tierLimitations;
|
|
47
|
+
const fact = (value) => ({ value, evidence });
|
|
48
|
+
const isoValues = source ? [...source.isoValues] : (version === "2.0.0" ? GENERIC_WHOLE_STOP_ISO_SETTINGS : GENERIC_THIRD_STOP_ISO_SETTINGS).filter((v) => v <= isoMax);
|
|
49
|
+
const baseIso = isoValues[0], single = sensor.highGainFromIso > isoMax;
|
|
46
50
|
const exposure = parseGenericBodyExposureCapabilityProfile({ schemaVersion: "0.1.0", profileId: id + ":exposure", profileVersion: version,
|
|
47
51
|
scientificStatus: "approximation", evidence, shutter: { durationSecondsRange: fact({ minimum: 1 / 8000, maximum: 30 }), settingGrid: { kind: "continuous-within-range" } },
|
|
48
|
-
iso: { range: fact({ minimum:
|
|
52
|
+
iso: { range: fact({ minimum: baseIso, maximum: isoMax }), settingGrid: { kind: "discrete-values", values: fact(isoValues) }, autoIso: fact("supported") } });
|
|
49
53
|
const iso = parseIsoCapabilityProfile({ schemaVersion: "0.1.0", profileId: id + ":iso", profileVersion: version,
|
|
50
|
-
capabilityMeaning: "reported-exposure-index-capability-not-physical-gain", standard: { exposureIndexRange: { minimum:
|
|
51
|
-
settingGrid: { kind: "discrete-values", values: isoValues } }, expandedSettings: [], autoIso: { availability: "supported", standardExposureIndexRange: { minimum:
|
|
54
|
+
capabilityMeaning: "reported-exposure-index-capability-not-physical-gain", standard: { exposureIndexRange: { minimum: baseIso, maximum: isoMax },
|
|
55
|
+
settingGrid: { kind: "discrete-values", values: isoValues } }, expandedSettings: [], autoIso: { availability: "supported", standardExposureIndexRange: { minimum: baseIso, maximum: isoMax }, evidence },
|
|
52
56
|
captureModePolicies: [], evidence });
|
|
53
|
-
const isoGain = createIsoGainReadoutRegimes({ regimeIdPrefix: "", scientificStatus: "approximation", baseExposureIndex:
|
|
57
|
+
const isoGain = createIsoGainReadoutRegimes({ regimeIdPrefix: "", scientificStatus: "approximation", baseExposureIndex: baseIso,
|
|
54
58
|
exposureIndices: isoValues, baseSaturationElectronEquivalent: fact(sensor.saturationElectrons), maximumAnalogGain: fact(sensor.maximumAnalogGain),
|
|
55
59
|
adc: { bitDepth: sensor.bitDepth, blackLevelCode: sensor.blackLevelCode, digitalSaturationCode: 2 ** sensor.bitDepth - 1 },
|
|
56
|
-
conversionGainModes: [{ mode: "
|
|
57
|
-
{ mode: "
|
|
58
|
-
|
|
60
|
+
conversionGainModes: single ? [{ mode: "single-conversion-gain", minimumExposureIndex: baseIso, readNoiseRmsElectrons: fact(sensor.lowGainReadNoise) }] :
|
|
61
|
+
[{ mode: "low-conversion-gain", minimumExposureIndex: baseIso, readNoiseRmsElectrons: fact(sensor.lowGainReadNoise) },
|
|
62
|
+
{ mode: "high-conversion-gain", minimumExposureIndex: sensor.highGainFromIso, readNoiseRmsElectrons: fact(sensor.highGainReadNoise),
|
|
63
|
+
maximumChargeElectrons: fact(sensor.highGainMaximumCharge) }],
|
|
59
64
|
evidence, limitations: [...limitations, "ISO gain follows the declared base-ISO saturation signal and analog range; read noise per conversion-gain mode is a synthetic design value."] });
|
|
60
65
|
const readout = ["red", "green", "blue"].map((channelId) => ({ assetId: id + ":readout:" + channelId, assetVersion: version,
|
|
61
66
|
profile: parseSensorReadoutConversionProfile({ schemaVersion: "0.1.0", profileId: id + ":readout", colorSamplingProfileId: "photivra-generic-bayer", channelId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-tier-assets.js","sourceRoot":"","sources":["../../src/equipment/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CAAC,CAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC,CAAC,EAAC,GAAG,EAAC,GAAG,CAAC,EAAE,CAAC;YAClK,SAAS,EAAE,CAAC,+HAA+H,CAAC,EAAE;KAC/I,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAA0C,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAC1G,IAAI,UAA6D,CAAC;AAClE,qFAAqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,mBAAmB,CAAC;IACpD,OAAO,UAAU,KAAK,sBAAsB,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Synthetic catalog data, owned by the project, for generic camera tiers. Bodies (capabilities and\n * readout) and lenses (optical and correction profiles) are defined separately.\n *\n * Choosing a tier changes explicit profile values. It never applies a universal quality multiplier.\n * The caller still supplies the CFA (colour filter array) and light-collection geometry and the\n * actual capture raster. The numbers are not measured calibration.\n * @see docs/RELEASE_1_0.md and the corresponding domain guide.\n */\n\nimport type { EvidenceBackedFact, EvidenceProvenance } from \"../core/evidence-provenance.js\";\nimport { parseGenericBodyExposureCapabilityProfile, parseGenericLensExposureCapabilityProfile,\n type GenericBodyExposureCapabilityProfile, type GenericLensExposureCapabilityProfile } from \"./exposure-capabilities.js\";\nimport { parseIsoCapabilityProfile, type IsoCapabilityProfile } from \"./iso-capabilities.js\";\nimport { parseGenericReleaseCapabilityProfile, type GenericReleaseCapabilityProfile } from \"./release-capabilities.js\";\nimport { parseFocusControlProfile, type FocusControlProfile } from \"../capture/focus-control.js\";\nimport { parseWhiteBalanceProfile, type WhiteBalanceProfile } from \"../color/white-balance.js\";\nimport { parseStabilizationSystemProfile, STABILIZATION_UNMODELED_SCOPE, type StabilizationSystemProfile } from \"../stabilization/system.js\";\nimport { parseSensorReadoutConversionProfile, type SensorReadoutConversionProfile } from \"../sensor/raw-readout.js\";\nimport { parseGenericIsoSignalChainProfile, type GenericIsoSignalChainProfile } from \"../sensor/iso-signal-chain.js\";\nimport { parseExposureMeteringProfile, type ExposureMeteringProfile } from \"../exposure/metering.js\";\nimport { parseGenericBodyMeteringCapabilityProfile, type GenericBodyMeteringCapabilityProfile } from \"./metering-capabilities.js\";\nimport { parseFlashSyncCapabilityProfile, type FlashSyncCapabilityProfile } from \"../exposure/flash.js\";\nimport type { SensorReadoutTimingDeclaration } from \"../sensor/readout-timing.js\";\nimport { createIsoGainReadoutRegimes } from \"../sensor/iso-gain.js\";\nimport { parseSensorFixedPatternNoiseProfile, type SensorFixedPatternNoiseProfile } from \"../sensor/fixed-pattern-noise.js\";\n\nexport type GenericEquipmentTier = \"consumer\" | \"prosumer\" | \"professional\";\nexport interface GenericVersionedAsset<T> { assetId: string; assetVersion: string; profile: T }\nexport interface GenericTierBodyAssets {\n exposure: GenericBodyExposureCapabilityProfile;\n iso: IsoCapabilityProfile;\n signalChain: GenericIsoSignalChainProfile;\n readout: readonly GenericVersionedAsset<SensorReadoutConversionProfile>[];\n /** Global data readout (no skew across the frame). The default timing asset. */\n readoutTiming: GenericVersionedAsset<SensorReadoutTimingDeclaration>;\n /** Optional rolling readout variant, with an explicit top-to-bottom skew across the frame. */\n rollingReadoutTiming: GenericVersionedAsset<SensorReadoutTimingDeclaration>;\n /** Optional synthetic fixed-pattern noise for this body. Never applied unless a caller attaches it. */\n fixedPatternNoise: GenericVersionedAsset<SensorFixedPatternNoiseProfile>;\n release: GenericReleaseCapabilityProfile;\n focus: FocusControlProfile;\n stabilization: StabilizationSystemProfile;\n whiteBalance: WhiteBalanceProfile;\n metering: readonly GenericVersionedAsset<ExposureMeteringProfile>[];\n meteringCapabilities: GenericBodyMeteringCapabilityProfile;\n flashSync: FlashSyncCapabilityProfile;\n}\nexport interface GenericTierLensAssets {\n form: \"prime\";\n exposure: GenericLensExposureCapabilityProfile;\n /** Explicit synthetic coefficients, not measured calibration or a quality score. */\n matchedReference: {\n focalLengthMm: 50; aperture: 4; focusDistanceM: 5; wavelengthNm: 550;\n normalizationRadiusMm: number;\n distortionK1: number; lateralCaK1Offset: number; vignettingR2: number;\n breathingProjectionScale: number; transmission: number;\n correctionGainStrength: number; correctionCaFraction: number;\n ghostPowerFraction: number; veilPowerFraction: number;\n pupilAmplitudeByField: readonly (readonly number[])[];\n pupilOpdMicrometersByDefocus: readonly (readonly number[])[];\n pupilThroughputByField: readonly number[];\n };\n profileReferences: readonly { profileId: string; profileVersion: string }[];\n limitations: readonly string[];\n}\nexport interface GenericEquipmentTierPreset {\n tier: GenericEquipmentTier;\n label: \"Consumer\" | \"Prosumer\" | \"Professional\";\n presetId: string; presetVersion: GenericTierPresetVersion;\n scientificStatus: \"approximation\";\n evidence: readonly EvidenceProvenance[];\n body: GenericTierBodyAssets;\n lens: GenericTierLensAssets;\n tradeoffs: readonly string[];\n}\n\nconst evidence: readonly EvidenceProvenance[] = [{ sourceOrigin: \"photivra\", sourceReference: \"photivra:generic-tier-assets-v1\",\n reuseStatus: \"photivra-owned\" }];\nconst limitations = [\"Synthetic educational design values; no named camera/lens calibration or population ranking.\"];\nconst fact = <T>(value: T): EvidenceBackedFact<T> => ({ value, evidence });\n/**\n * The exact versions of the generic tier presets (no \"latest\" alias). 2.1.0 (2.14, round 5) adds the third-stop ISO\n * settings; 2.0.0 is kept, whole-stop, so saved selections and records of it still resolve to exactly what they named.\n */\nexport type GenericTierPresetVersion = \"2.0.0\" | \"2.1.0\";\n/** Whole-stop ISO settings of the 2.0.0 bodies (each body's list stops at its maximum). */\nexport const GENERIC_WHOLE_STOP_ISO_SETTINGS = /* @__PURE__ */ Object.freeze([100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600] as const);\n/**\n * Third-stop ISO settings of the 2.1.0 bodies: the conventional rounded markings of S = 100·2^(k/3), k = 0 … 24 (125 for\n * 126.0, 160 for 158.7 …; each within 2 % of the exact value). The engine takes the setting as the exact ISO speed.\n */\n/**\n * The standard third-stop shutter times, seconds, from 1/8000 s to 30 s: the conventional markings of t = 2^(k/3) s\n * (1/8000 for 2^−13, 1/6 for 2^−8/3, 0.3 for 2^−5/3, 30 for 2^5; each within 7 % of the exact value). The generic bodies'\n * shutters are continuous over 1/8000–30 s and take any time as exact, so these are the values to offer in a third-stop\n * dial, not a restriction.\n */\nexport const GENERIC_THIRD_STOP_SHUTTER_SECONDS = /* @__PURE__ */ Object.freeze([1 / 8000, 1 / 6400, 1 / 5000, 1 / 4000, 1 / 3200, 1 / 2500, 1 / 2000,\n 1 / 1600, 1 / 1250, 1 / 1000, 1 / 800, 1 / 640, 1 / 500, 1 / 400, 1 / 320, 1 / 250, 1 / 200, 1 / 160, 1 / 125, 1 / 100, 1 / 80, 1 / 60, 1 / 50, 1 / 40,\n 1 / 30, 1 / 25, 1 / 20, 1 / 15, 1 / 13, 1 / 10, 1 / 8, 1 / 6, 1 / 5, 1 / 4, 0.3, 0.4, 0.5, 0.6, 0.8, 1, 1.3, 1.6, 2, 2.5, 3.2, 4, 5, 6, 8, 10, 13,\n 15, 20, 25, 30] as const);\nexport const GENERIC_THIRD_STOP_ISO_SETTINGS = /* @__PURE__ */ Object.freeze([100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600,\n 2000, 2500, 3200, 4000, 5000, 6400, 8000, 10000, 12800, 16000, 20000, 25600] as const);\nconst disk = [0,0,1,0,0, 0,1,1,1,0, 1,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0];\nconst clipped = [0,0,1,0,0, 0,1,1,1,0, 0,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0];\nconst clippedMore = [0,0,0,0,0, 0,0,1,1,0, 0,0,1,1,1, 0,0,1,1,0, 0,0,0,0,0];\nconst near = [0,0,.12,0,0, 0,.06,0,.06,0, .12,0,-.04,0,.12, 0,.06,0,.06,0, 0,0,.12,0,0];\nconst flat = Array<number>(25).fill(0);\nconst far = near.map((v) => -v);\n\n/**\n * Synthetic, educational sensor design values for each tier: ADC (analogue-to-digital converter),\n * saturation signal Q0 at base ISO, analogue gain range, read noise for each conversion-gain mode,\n * and fixed-pattern noise sizes. They are plausible orders of magnitude for consumer\n * interchangeable-lens sensors. They are not data from any real camera.\n */\ninterface SyntheticSensorDesign {\n bitDepth: number; blackLevelCode: number; saturationElectrons: number; maximumAnalogGain: number;\n lowGainReadNoise: number; highGainReadNoise: number; highGainFromIso: number; highGainMaximumCharge: number;\n prnu: number; dsnu: number; hotFraction: number; hotMultiplier: number; rowRms: number; columnRms: number; instanceSeed: number;\n}\n/** Used only to build data. Tier labels never enter any scientific equation. */\nfunction bodyAssets(version: GenericTierPresetVersion, id: string, isoMax: number, cadence: number, frames: number, sensor: SyntheticSensorDesign,\n dataReadoutSeconds: number, gain: number, maxAngle: number, continuousAf: boolean, advancedPolicies: boolean): GenericTierBodyAssets {\n const isoValues: number[] = (version === \"2.0.0\" ? GENERIC_WHOLE_STOP_ISO_SETTINGS : GENERIC_THIRD_STOP_ISO_SETTINGS).filter((v) => v <= isoMax);\n const exposure = parseGenericBodyExposureCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":exposure\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, shutter: { durationSecondsRange: fact({ minimum: 1/8000, maximum: 30 }), settingGrid: { kind: \"continuous-within-range\" } },\n iso: { range: fact({ minimum: 100, maximum: isoMax }), settingGrid: { kind: \"discrete-values\", values: fact(isoValues) }, autoIso: fact(\"supported\") } });\n const iso = parseIsoCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":iso\", profileVersion: version,\n capabilityMeaning: \"reported-exposure-index-capability-not-physical-gain\", standard: { exposureIndexRange: { minimum: 100, maximum: isoMax },\n settingGrid: { kind: \"discrete-values\", values: isoValues } }, expandedSettings: [], autoIso: { availability: \"supported\", standardExposureIndexRange: { minimum: 100, maximum: isoMax }, evidence },\n captureModePolicies: [], evidence });\n const isoGain = createIsoGainReadoutRegimes({ regimeIdPrefix: \"\", scientificStatus: \"approximation\", baseExposureIndex: 100,\n exposureIndices: isoValues, baseSaturationElectronEquivalent: fact(sensor.saturationElectrons), maximumAnalogGain: fact(sensor.maximumAnalogGain),\n adc: { bitDepth: sensor.bitDepth, blackLevelCode: sensor.blackLevelCode, digitalSaturationCode: 2**sensor.bitDepth-1 },\n conversionGainModes: [{ mode: \"low-conversion-gain\", minimumExposureIndex: 100, readNoiseRmsElectrons: fact(sensor.lowGainReadNoise) },\n { mode: \"high-conversion-gain\", minimumExposureIndex: sensor.highGainFromIso, readNoiseRmsElectrons: fact(sensor.highGainReadNoise),\n maximumChargeElectrons: fact(sensor.highGainMaximumCharge) }],\n evidence, limitations: [...limitations, \"ISO gain follows the declared base-ISO saturation signal and analog range; read noise per conversion-gain mode is a synthetic design value.\"] });\n const readout = [\"red\", \"green\", \"blue\"].map((channelId): GenericVersionedAsset<SensorReadoutConversionProfile> => ({ assetId: id+\":readout:\"+channelId, assetVersion: version,\n profile: parseSensorReadoutConversionProfile({ schemaVersion: \"0.1.0\", profileId: id+\":readout\", colorSamplingProfileId: \"photivra-generic-bayer\", channelId,\n regimeSelectionOwnedBy: \"explicit-upstream-camera-state-not-inferred-from-iso\", evidence, regimes: isoGain.regimes }) }));\n const signalChain = parseGenericIsoSignalChainProfile({ schemaVersion: \"0.1.0\", profileId: id+\":signal-chain\", profileVersion: version,\n scientificStatus: \"approximation\", isoCapabilityProfileId: iso.profileId, readoutProfileId: id+\":readout\",\n behaviorMeaning: \"iso-state-selects-explicit-readout-regime-not-noise-equation\", captureModeBindings: [{ captureModeId: \"native-still\",\n standardRegimeBands: isoGain.standardRegimeBands, expandedRegimeBindings: [], evidence }],\n photonShotNoiseOwnedUpstream: true, processedImageBehaviorIncluded: false, fixedPatternNoiseModeled: false, lowSignalColorDegradationModeled: false,\n evidence, limitations });\n const release = parseGenericReleaseCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":release\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, supportedDriveModes: fact([\"single\", \"burst\", \"self-timer\"]), maximumLogicalFramesPerSequence: fact(frames),\n maximumCadenceFps: fact(cadence), minimumInterFrameGapSeconds: fact(0), overlappingOrdinaryStillExposures: false,\n exposureBracketing: { availability: fact(\"supported\"), supportedAxes: [\"shutter\", \"iso\"] }, focusBracketing: { availability: fact(\"unsupported\") } });\n const focus = parseFocusControlProfile({ schemaVersion: \"0.1.0\", profileId: id+\":focus\", profileVersion: version, scientificStatus: \"approximation\",\n supportedModes: continuousAf ? [\"manual\", \"single-af\", \"continuous-af\"] : [\"manual\", \"single-af\"], actuator: { kind: \"ideal-instantaneous\", evidence },\n continuousTargetLossPolicy: \"hold-last-focus-require-explicit-reacquisition\", supportedReleasePriorities: [\"focus-priority\", \"release-priority\", \"balanced\"],\n evidence, limitations: [...limitations, \"AF actuator speed and subject recognition are not tier performance claims.\"] });\n const stabilization = parseStabilizationSystemProfile({ schemaVersion: \"0.1.0\", profileId: id+\":stabilization\", profileVersion: version,\n profileKind: \"generic-synthetic\", scientificStatus: \"approximation\", architecture: \"sensor-shift\", captureKind: \"still\",\n axisResponses: [\"pitch\", \"yaw\", \"roll\"].map((axis) => ({ axis, correctionGain: fact(gain), latencySeconds: fact(.001), maximumCorrectionAngleRad: fact(maxAngle) })),\n panningPolicy: { kind: \"none\" }, ...STABILIZATION_UNMODELED_SCOPE, evidence, limitations });\n const whiteBalance = parseWhiteBalanceProfile({ schemaVersion: \"0.1.0\", profileId: id+\":white-balance\", profileVersion: version,\n scientificStatus: \"approximation\", inputDomain: \"relative-pre-wb-camera-linear-rgb\", presets: [{ presetId: \"neutral\", label: \"Neutral reference\",\n channelGains: fact({ red: 1, green: 1, blue: 1 }) }], awbPolicies: [\n { policyId: \"neutral-priority\", intent: \"neutral-priority\", correctionStrength: fact(1) },\n ...(advancedPolicies ? [{ policyId: \"ambience\", intent: \"ambience-preserving\", correctionStrength: fact(.5) }] : [])], evidence, limitations });\n const metering = [{ kind: \"multi-zone-uniform\" }, ...(advancedPolicies ? [{ kind: \"highlight-weighted\", minimumWeightFraction: .2, exponent: 2 }] : [])]\n .map((policy): GenericVersionedAsset<ExposureMeteringProfile> => ({ assetId: id+\":meter:\"+policy.kind, assetVersion: version,\n profile: parseExposureMeteringProfile({ schemaVersion: \"0.1.0\", profileId: id+\":meter:\"+policy.kind, scientificStatus: \"approximation\",\n inputDomain: \"relative-pre-exposure-linear-signal\", captureRegion: \"oriented-active-capture\", policy,\n target: { kind: \"relative-signal-reference\", targetRelativeSignal: .18, evidence }, evidence,\n limitations: [...limitations, \"0.18 is a declared target policy, not universal scene/camera truth.\"] }) }));\n const meteringCapabilities = parseGenericBodyMeteringCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":metering-capabilities\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, supportedMeteringProfiles: metering.map((m) => ({ meteringProfileId: m.profile.profileId, policyKind: m.profile.policy.kind, evidence })),\n spotFocusPointLinkage: { availability: \"unsupported\", evidence } });\n const timingId = id+\":data-readout\";\n const fixedPatternNoise = parseSensorFixedPatternNoiseProfile({ schemaVersion: \"0.1.0\", profileId: id+\":fixed-pattern\",\n colorSamplingProfileId: \"photivra-generic-bayer\", scientificStatus: \"approximation\", sensorInstanceSeedUint32: sensor.instanceSeed,\n photoResponseNonUniformity: { relativeStandardDeviation: fact(sensor.prnu) }, darkSignalNonUniformity: { relativeStandardDeviation: fact(sensor.dsnu) },\n hotPixels: { siteFraction: fact(sensor.hotFraction), darkCurrentMultiplier: fact(sensor.hotMultiplier) },\n rowOffset: { rmsElectrons: fact(sensor.rowRms) }, columnOffset: { rmsElectrons: fact(sensor.columnRms) },\n patternDistribution: \"normal-factors-truncated-at-zero\", evidence,\n limitations: [...limitations, \"Synthetic fixed-pattern magnitudes for teaching; opt-in only and not a measured sensor population.\"] });\n return { exposure, iso, signalChain, readout, release, focus, stabilization, whiteBalance, metering, meteringCapabilities,\n readoutTiming: { assetId: timingId, assetVersion: version, profile: { readoutMode: \"global\", captureReadoutDurationSeconds: {\n value: dataReadoutSeconds, unit: \"s\", evidence } } },\n rollingReadoutTiming: { assetId: id+\":rolling-data-readout\", assetVersion: version, profile: { readoutMode: \"rolling\",\n captureReadoutDurationSeconds: { value: dataReadoutSeconds, unit: \"s\", evidence }, scanDirectionNative: fact(\"top-to-bottom\"),\n spatialSamplingSkewSeconds: { value: dataReadoutSeconds, unit: \"s\", evidence } } },\n fixedPatternNoise: { assetId: id+\":fixed-pattern\", assetVersion: version, profile: fixedPatternNoise },\n flashSync: parseFlashSyncCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":flash-sync\", profileVersion: version,\n captureModeId: \"native-still\", timingProfileId: timingId, supportedOrdinarySyncModes: [\"front-curtain\", \"rear-curtain\"],\n highSpeedSyncSupported: false, ordinarySyncRequiresWholeActiveFrameSimultaneouslyExposed: true, evidence, limitations }) };\n}\nfunction lensAssets(version: GenericTierPresetVersion, id: string, r: GenericTierLensAssets[\"matchedReference\"]): GenericTierLensAssets {\n return { form: \"prime\", exposure: parseGenericLensExposureCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":exposure\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, focalLengthMmRange: fact({ minimum: 50, maximum: 50 }), aperture: { widestAvailableFNumber: {\n kind: \"constant\", fNumber: fact(4) }, narrowestAvailableFNumber: fact(16), settingGrid: { kind: \"continuous-within-range\" } } }),\n matchedReference: r, profileReferences: [\"radial\", \"lateral-ca\", \"vignetting\", \"breathing\", \"transmission\", \"pupil\", \"stray\", \"correction\"]\n .map((role) => ({ profileId: id+\":\"+role, profileVersion: version })),\n limitations: [...limitations, \"Optical reference response is limited to 50 mm, f/4, focus 5 m and explicit field/defocus/wavelength slices; capabilities do not authorize extrapolation.\",\n \"The initial prime has no OIS; body stabilization is separate.\"] };\n}\nconst common = { focalLengthMm: 50 as const, aperture: 4 as const, focusDistanceM: 5 as const, wavelengthNm: 550 as const,\n normalizationRadiusMm: Math.hypot(18,12), correctionCaFraction: .8 };\nfunction buildGenericTierAssets(version: GenericTierPresetVersion): readonly GenericEquipmentTierPreset[] {\n return [\n { tier: \"consumer\", label: \"Consumer\", presetId: \"photivra-consumer\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-consumer-body\", 6400, 4, 8, { bitDepth: 12, blackLevelCode: 256, saturationElectrons: 20000,\n maximumAnalogGain: 32, lowGainReadNoise: 6, highGainReadNoise: 2.5, highGainFromIso: 800, highGainMaximumCharge: 6000,\n prnu: .01, dsnu: .3, hotFraction: 2e-4, hotMultiplier: 50, rowRms: .6, columnRms: .4, instanceSeed: 0x51ed270b }, .03, .35, .005, false, false),\n lens: lensAssets(version, \"photivra-consumer-prime\", { ...common, distortionK1: -.06, lateralCaK1Offset: .008, vignettingR2: -.5,\n breathingProjectionScale: 1.03, transmission: .75, correctionGainStrength: .8, ghostPowerFraction: .006, veilPowerFraction: .012,\n pupilAmplitudeByField: [disk, clipped, clippedMore], pupilOpdMicrometersByDefocus: [near, flat, far], pupilThroughputByField: [1,.85,.65] }),\n tradeoffs: [\"Limited continuous AF; heavier digital correction and edge pupil clipping in matched reference.\"] },\n { tier: \"prosumer\", label: \"Prosumer\", presetId: \"photivra-prosumer\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-prosumer-body\", 12800, 8, 16, { bitDepth: 14, blackLevelCode: 1024, saturationElectrons: 40000,\n maximumAnalogGain: 64, lowGainReadNoise: 3, highGainReadNoise: 1.4, highGainFromIso: 800, highGainMaximumCharge: 12000,\n prnu: .006, dsnu: .2, hotFraction: 1e-4, hotMultiplier: 40, rowRms: .3, columnRms: .2, instanceSeed: 0x2c1b3c6d }, .015, .65, .01, true, true),\n lens: lensAssets(version, \"photivra-prosumer-prime\", { ...common, distortionK1: -.025, lateralCaK1Offset: .004, vignettingR2: -.25,\n breathingProjectionScale: 1.015, transmission: .85, correctionGainStrength: .6, ghostPowerFraction: .003, veilPowerFraction: .006,\n pupilAmplitudeByField: [disk, disk, clipped], pupilOpdMicrometersByDefocus: [near.map((v)=>v*.7), flat, far.map((v)=>v*.7)], pupilThroughputByField: [1,.95,.85] }),\n tradeoffs: [\"Lower matched-reference peripheral gain/noise amplification than Professional; not universally inferior.\"] },\n { tier: \"professional\", label: \"Professional\", presetId: \"photivra-professional\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-professional-body\", 25600, 12, 24, { bitDepth: 14, blackLevelCode: 1024, saturationElectrons: 60000,\n maximumAnalogGain: 128, lowGainReadNoise: 2, highGainReadNoise: 1.1, highGainFromIso: 800, highGainMaximumCharge: 16000,\n prnu: .004, dsnu: .15, hotFraction: 5e-5, hotMultiplier: 30, rowRms: .15, columnRms: .1, instanceSeed: 0x6a09e667 }, .008, .85, .02, true, true),\n lens: lensAssets(version, \"photivra-professional-prime\", { ...common, distortionK1: -.01, lateralCaK1Offset: .002, vignettingR2: -.35,\n breathingProjectionScale: 1.005, transmission: .9, correctionGainStrength: .8, ghostPowerFraction: .001, veilPowerFraction: .002,\n pupilAmplitudeByField: [disk, disk, disk], pupilOpdMicrometersByDefocus: [near.map((v)=>v*.9), flat, far.map((v)=>v*.6)], pupilThroughputByField: [1,.98,.95] }),\n tradeoffs: [\"Less edge clipping/stray light, with greater f/4 falloff/gain cost than Prosumer and asymmetric near/far wavefront character.\"] }\n ];\n}\n\n/** The presets of the current version, 2.1.0 (third-stop ISO settings). */\nexport const GENERIC_TIER_ASSETS: readonly GenericEquipmentTierPreset[] = buildGenericTierAssets(\"2.1.0\");\nlet historical: readonly GenericEquipmentTierPreset[] | undefined;\n/** The presets of an exact version; 2.0.0 (whole-stop ISO) is built on first use. */\nexport function genericTierAssets(version: GenericTierPresetVersion): readonly GenericEquipmentTierPreset[] {\n if (version === \"2.1.0\") return GENERIC_TIER_ASSETS;\n return historical ??= buildGenericTierAssets(\"2.0.0\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"generic-tier-assets.js","sourceRoot":"","sources":["../../src/equipment/generic-tier-assets.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAatC,OAAO,EAAE,yCAAyC,EAAE,yCAAyC,EACL,MAAM,4BAA4B,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAA6B,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,oCAAoC,EAAwC,MAAM,2BAA2B,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAA4B,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAA4B,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAmC,MAAM,4BAA4B,CAAC;AAC7I,OAAO,EAAE,mCAAmC,EAAuC,MAAM,0BAA0B,CAAC;AACpH,OAAO,EAAE,iCAAiC,EAAqC,MAAM,+BAA+B,CAAC;AACrH,OAAO,EAAE,4BAA4B,EAAgC,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,yCAAyC,EAA6C,MAAM,4BAA4B,CAAC;AAClI,OAAO,EAAE,+BAA+B,EAAmC,MAAM,sBAAsB,CAAC;AAExG,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,mCAAmC,EAAuC,MAAM,kCAAkC,CAAC;AAoD5H,MAAM,YAAY,GAAkC,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,iCAAiC;QACjI,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACnC,MAAM,eAAe,GAAG,CAAC,8FAA8F,CAAC,CAAC;AACzH,MAAM,QAAQ,GAAG,YAAY,EAAE,WAAW,GAAG,eAAe,CAAC;AAC7D,MAAM,IAAI,GAAG,CAAI,KAAQ,EAAyB,EAAE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CAAC;AAClE,qFAAqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,mBAAmB,CAAC;IACpD,OAAO,UAAU,KAAK,sBAAsB,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Synthetic catalog data, owned by the project, for generic camera tiers. Bodies (capabilities and\n * readout) and lenses (optical and correction profiles) are defined separately.\n *\n * Choosing a tier changes explicit profile values. It never applies a universal quality multiplier.\n * The caller still supplies the CFA (colour filter array) and light-collection geometry and the\n * actual capture raster. The numbers are not measured calibration.\n * @see docs/RELEASE_1_0.md and the corresponding domain guide.\n */\n\nimport type { EvidenceBackedFact, EvidenceProvenance } from \"../core/evidence-provenance.js\";\nimport { parseGenericBodyExposureCapabilityProfile, parseGenericLensExposureCapabilityProfile,\n type GenericBodyExposureCapabilityProfile, type GenericLensExposureCapabilityProfile } from \"./exposure-capabilities.js\";\nimport { parseIsoCapabilityProfile, type IsoCapabilityProfile } from \"./iso-capabilities.js\";\nimport { parseGenericReleaseCapabilityProfile, type GenericReleaseCapabilityProfile } from \"./release-capabilities.js\";\nimport { parseFocusControlProfile, type FocusControlProfile } from \"../capture/focus-control.js\";\nimport { parseWhiteBalanceProfile, type WhiteBalanceProfile } from \"../color/white-balance.js\";\nimport { parseStabilizationSystemProfile, STABILIZATION_UNMODELED_SCOPE, type StabilizationSystemProfile } from \"../stabilization/system.js\";\nimport { parseSensorReadoutConversionProfile, type SensorReadoutConversionProfile } from \"../sensor/raw-readout.js\";\nimport { parseGenericIsoSignalChainProfile, type GenericIsoSignalChainProfile } from \"../sensor/iso-signal-chain.js\";\nimport { parseExposureMeteringProfile, type ExposureMeteringProfile } from \"../exposure/metering.js\";\nimport { parseGenericBodyMeteringCapabilityProfile, type GenericBodyMeteringCapabilityProfile } from \"./metering-capabilities.js\";\nimport { parseFlashSyncCapabilityProfile, type FlashSyncCapabilityProfile } from \"../exposure/flash.js\";\nimport type { SensorReadoutTimingDeclaration } from \"../sensor/readout-timing.js\";\nimport { createIsoGainReadoutRegimes } from \"../sensor/iso-gain.js\";\nimport { parseSensorFixedPatternNoiseProfile, type SensorFixedPatternNoiseProfile } from \"../sensor/fixed-pattern-noise.js\";\n\nexport type GenericEquipmentTier = \"consumer\" | \"prosumer\" | \"professional\";\nexport interface GenericVersionedAsset<T> { assetId: string; assetVersion: string; profile: T }\nexport interface GenericTierBodyAssets {\n exposure: GenericBodyExposureCapabilityProfile;\n iso: IsoCapabilityProfile;\n signalChain: GenericIsoSignalChainProfile;\n readout: readonly GenericVersionedAsset<SensorReadoutConversionProfile>[];\n /** Global data readout (no skew across the frame). The default timing asset. */\n readoutTiming: GenericVersionedAsset<SensorReadoutTimingDeclaration>;\n /** Optional rolling readout variant, with an explicit top-to-bottom skew across the frame. */\n rollingReadoutTiming: GenericVersionedAsset<SensorReadoutTimingDeclaration>;\n /** Optional synthetic fixed-pattern noise for this body. Never applied unless a caller attaches it. */\n fixedPatternNoise: GenericVersionedAsset<SensorFixedPatternNoiseProfile>;\n release: GenericReleaseCapabilityProfile;\n focus: FocusControlProfile;\n stabilization: StabilizationSystemProfile;\n whiteBalance: WhiteBalanceProfile;\n metering: readonly GenericVersionedAsset<ExposureMeteringProfile>[];\n meteringCapabilities: GenericBodyMeteringCapabilityProfile;\n flashSync: FlashSyncCapabilityProfile;\n}\nexport interface GenericTierLensAssets {\n form: \"prime\";\n exposure: GenericLensExposureCapabilityProfile;\n /** Explicit synthetic coefficients, not measured calibration or a quality score. */\n matchedReference: {\n focalLengthMm: 50; aperture: 4; focusDistanceM: 5; wavelengthNm: 550;\n normalizationRadiusMm: number;\n distortionK1: number; lateralCaK1Offset: number; vignettingR2: number;\n breathingProjectionScale: number; transmission: number;\n correctionGainStrength: number; correctionCaFraction: number;\n ghostPowerFraction: number; veilPowerFraction: number;\n pupilAmplitudeByField: readonly (readonly number[])[];\n pupilOpdMicrometersByDefocus: readonly (readonly number[])[];\n pupilThroughputByField: readonly number[];\n };\n profileReferences: readonly { profileId: string; profileVersion: string }[];\n limitations: readonly string[];\n}\nexport interface GenericEquipmentTierPreset {\n tier: GenericEquipmentTier;\n label: \"Consumer\" | \"Prosumer\" | \"Professional\";\n presetId: string; presetVersion: GenericTierPresetVersion;\n scientificStatus: \"approximation\";\n evidence: readonly EvidenceProvenance[];\n body: GenericTierBodyAssets;\n lens: GenericTierLensAssets;\n tradeoffs: readonly string[];\n}\n\nconst tierEvidence: readonly EvidenceProvenance[] = [{ sourceOrigin: \"photivra\", sourceReference: \"photivra:generic-tier-assets-v1\",\n reuseStatus: \"photivra-owned\" }];\nconst tierLimitations = [\"Synthetic educational design values; no named camera/lens calibration or population ranking.\"];\nconst evidence = tierEvidence, limitations = tierLimitations;\nconst fact = <T>(value: T): EvidenceBackedFact<T> => ({ value, evidence });\n/**\n * The exact versions of the generic tier presets (no \"latest\" alias). 2.1.0 (2.14, round 5) adds the third-stop ISO\n * settings; 2.0.0 is kept, whole-stop, so saved selections and records of it still resolve to exactly what they named.\n */\nexport type GenericTierPresetVersion = \"2.0.0\" | \"2.1.0\";\n/** Whole-stop ISO settings of the 2.0.0 bodies (each body's list stops at its maximum). */\nexport const GENERIC_WHOLE_STOP_ISO_SETTINGS = /* @__PURE__ */ Object.freeze([100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600] as const);\n/**\n * Third-stop ISO settings of the 2.1.0 bodies: the conventional rounded markings of S = 100·2^(k/3), k = 0 … 24 (125 for\n * 126.0, 160 for 158.7 …; each within 2 % of the exact value). The engine takes the setting as the exact ISO speed.\n */\n/**\n * The standard third-stop shutter times, seconds, from 1/8000 s to 30 s: the conventional markings of t = 2^(k/3) s\n * (1/8000 for 2^−13, 1/6 for 2^−8/3, 0.3 for 2^−5/3, 30 for 2^5; each within 7 % of the exact value). The generic bodies'\n * shutters are continuous over 1/8000–30 s and take any time as exact, so these are the values to offer in a third-stop\n * dial, not a restriction.\n */\nexport const GENERIC_THIRD_STOP_SHUTTER_SECONDS = /* @__PURE__ */ Object.freeze([1 / 8000, 1 / 6400, 1 / 5000, 1 / 4000, 1 / 3200, 1 / 2500, 1 / 2000,\n 1 / 1600, 1 / 1250, 1 / 1000, 1 / 800, 1 / 640, 1 / 500, 1 / 400, 1 / 320, 1 / 250, 1 / 200, 1 / 160, 1 / 125, 1 / 100, 1 / 80, 1 / 60, 1 / 50, 1 / 40,\n 1 / 30, 1 / 25, 1 / 20, 1 / 15, 1 / 13, 1 / 10, 1 / 8, 1 / 6, 1 / 5, 1 / 4, 0.3, 0.4, 0.5, 0.6, 0.8, 1, 1.3, 1.6, 2, 2.5, 3.2, 4, 5, 6, 8, 10, 13,\n 15, 20, 25, 30] as const);\nexport const GENERIC_THIRD_STOP_ISO_SETTINGS = /* @__PURE__ */ Object.freeze([100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600,\n 2000, 2500, 3200, 4000, 5000, 6400, 8000, 10000, 12800, 16000, 20000, 25600] as const);\nconst disk = [0,0,1,0,0, 0,1,1,1,0, 1,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0];\nconst clipped = [0,0,1,0,0, 0,1,1,1,0, 0,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0];\nconst clippedMore = [0,0,0,0,0, 0,0,1,1,0, 0,0,1,1,1, 0,0,1,1,0, 0,0,0,0,0];\nconst near = [0,0,.12,0,0, 0,.06,0,.06,0, .12,0,-.04,0,.12, 0,.06,0,.06,0, 0,0,.12,0,0];\nconst flat = Array<number>(25).fill(0);\nconst far = near.map((v) => -v);\n\n/**\n * Synthetic, educational sensor design values for each tier: ADC (analogue-to-digital converter),\n * saturation signal Q0 at base ISO, analogue gain range, read noise for each conversion-gain mode,\n * and fixed-pattern noise sizes. They are plausible orders of magnitude for consumer\n * interchangeable-lens sensors. They are not data from any real camera.\n */\nexport interface SyntheticSensorDesign {\n bitDepth: number; blackLevelCode: number; saturationElectrons: number; maximumAnalogGain: number;\n /** #554: a high gain from above the top ISO (or equal read noise) is one conversion gain, `single-conversion-gain`. */\n lowGainReadNoise: number; highGainReadNoise: number; highGainFromIso: number; highGainMaximumCharge: number;\n prnu: number; dsnu: number; hotFraction: number; hotMultiplier: number; rowRms: number; columnRms: number; instanceSeed: number;\n}\n/** #554: a sensor profile's own ISO settings (base first) and provenance; the tiers use ISO 100 and their own. */\nexport interface GenericBodyAssetsSource { isoValues: readonly number[]; evidence: readonly EvidenceProvenance[]; limitations: readonly string[] }\n/** Used only to build data. Tier labels never enter any scientific equation. */\nexport function bodyAssets(version: GenericTierPresetVersion, id: string, isoMax: number, cadence: number, frames: number, sensor: SyntheticSensorDesign,\n dataReadoutSeconds: number, gain: number, maxAngle: number, continuousAf: boolean, advancedPolicies: boolean, source?: GenericBodyAssetsSource): GenericTierBodyAssets {\n const evidence = source?.evidence ?? tierEvidence, limitations = source?.limitations ?? tierLimitations;\n const fact = <T>(value: T): EvidenceBackedFact<T> => ({ value, evidence });\n const isoValues: number[] = source ? [...source.isoValues] : (version === \"2.0.0\" ? GENERIC_WHOLE_STOP_ISO_SETTINGS : GENERIC_THIRD_STOP_ISO_SETTINGS).filter((v) => v <= isoMax);\n const baseIso = isoValues[0]!, single = sensor.highGainFromIso > isoMax;\n const exposure = parseGenericBodyExposureCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":exposure\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, shutter: { durationSecondsRange: fact({ minimum: 1/8000, maximum: 30 }), settingGrid: { kind: \"continuous-within-range\" } },\n iso: { range: fact({ minimum: baseIso, maximum: isoMax }), settingGrid: { kind: \"discrete-values\", values: fact(isoValues) }, autoIso: fact(\"supported\") } });\n const iso = parseIsoCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":iso\", profileVersion: version,\n capabilityMeaning: \"reported-exposure-index-capability-not-physical-gain\", standard: { exposureIndexRange: { minimum: baseIso, maximum: isoMax },\n settingGrid: { kind: \"discrete-values\", values: isoValues } }, expandedSettings: [], autoIso: { availability: \"supported\", standardExposureIndexRange: { minimum: baseIso, maximum: isoMax }, evidence },\n captureModePolicies: [], evidence });\n const isoGain = createIsoGainReadoutRegimes({ regimeIdPrefix: \"\", scientificStatus: \"approximation\", baseExposureIndex: baseIso,\n exposureIndices: isoValues, baseSaturationElectronEquivalent: fact(sensor.saturationElectrons), maximumAnalogGain: fact(sensor.maximumAnalogGain),\n adc: { bitDepth: sensor.bitDepth, blackLevelCode: sensor.blackLevelCode, digitalSaturationCode: 2**sensor.bitDepth-1 },\n conversionGainModes: single ? [{ mode: \"single-conversion-gain\", minimumExposureIndex: baseIso, readNoiseRmsElectrons: fact(sensor.lowGainReadNoise) }] :\n [{ mode: \"low-conversion-gain\", minimumExposureIndex: baseIso, readNoiseRmsElectrons: fact(sensor.lowGainReadNoise) },\n { mode: \"high-conversion-gain\", minimumExposureIndex: sensor.highGainFromIso, readNoiseRmsElectrons: fact(sensor.highGainReadNoise),\n maximumChargeElectrons: fact(sensor.highGainMaximumCharge) }],\n evidence, limitations: [...limitations, \"ISO gain follows the declared base-ISO saturation signal and analog range; read noise per conversion-gain mode is a synthetic design value.\"] });\n const readout = [\"red\", \"green\", \"blue\"].map((channelId): GenericVersionedAsset<SensorReadoutConversionProfile> => ({ assetId: id+\":readout:\"+channelId, assetVersion: version,\n profile: parseSensorReadoutConversionProfile({ schemaVersion: \"0.1.0\", profileId: id+\":readout\", colorSamplingProfileId: \"photivra-generic-bayer\", channelId,\n regimeSelectionOwnedBy: \"explicit-upstream-camera-state-not-inferred-from-iso\", evidence, regimes: isoGain.regimes }) }));\n const signalChain = parseGenericIsoSignalChainProfile({ schemaVersion: \"0.1.0\", profileId: id+\":signal-chain\", profileVersion: version,\n scientificStatus: \"approximation\", isoCapabilityProfileId: iso.profileId, readoutProfileId: id+\":readout\",\n behaviorMeaning: \"iso-state-selects-explicit-readout-regime-not-noise-equation\", captureModeBindings: [{ captureModeId: \"native-still\",\n standardRegimeBands: isoGain.standardRegimeBands, expandedRegimeBindings: [], evidence }],\n photonShotNoiseOwnedUpstream: true, processedImageBehaviorIncluded: false, fixedPatternNoiseModeled: false, lowSignalColorDegradationModeled: false,\n evidence, limitations });\n const release = parseGenericReleaseCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":release\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, supportedDriveModes: fact([\"single\", \"burst\", \"self-timer\"]), maximumLogicalFramesPerSequence: fact(frames),\n maximumCadenceFps: fact(cadence), minimumInterFrameGapSeconds: fact(0), overlappingOrdinaryStillExposures: false,\n exposureBracketing: { availability: fact(\"supported\"), supportedAxes: [\"shutter\", \"iso\"] }, focusBracketing: { availability: fact(\"unsupported\") } });\n const focus = parseFocusControlProfile({ schemaVersion: \"0.1.0\", profileId: id+\":focus\", profileVersion: version, scientificStatus: \"approximation\",\n supportedModes: continuousAf ? [\"manual\", \"single-af\", \"continuous-af\"] : [\"manual\", \"single-af\"], actuator: { kind: \"ideal-instantaneous\", evidence },\n continuousTargetLossPolicy: \"hold-last-focus-require-explicit-reacquisition\", supportedReleasePriorities: [\"focus-priority\", \"release-priority\", \"balanced\"],\n evidence, limitations: [...limitations, \"AF actuator speed and subject recognition are not tier performance claims.\"] });\n const stabilization = parseStabilizationSystemProfile({ schemaVersion: \"0.1.0\", profileId: id+\":stabilization\", profileVersion: version,\n profileKind: \"generic-synthetic\", scientificStatus: \"approximation\", architecture: \"sensor-shift\", captureKind: \"still\",\n axisResponses: [\"pitch\", \"yaw\", \"roll\"].map((axis) => ({ axis, correctionGain: fact(gain), latencySeconds: fact(.001), maximumCorrectionAngleRad: fact(maxAngle) })),\n panningPolicy: { kind: \"none\" }, ...STABILIZATION_UNMODELED_SCOPE, evidence, limitations });\n const whiteBalance = parseWhiteBalanceProfile({ schemaVersion: \"0.1.0\", profileId: id+\":white-balance\", profileVersion: version,\n scientificStatus: \"approximation\", inputDomain: \"relative-pre-wb-camera-linear-rgb\", presets: [{ presetId: \"neutral\", label: \"Neutral reference\",\n channelGains: fact({ red: 1, green: 1, blue: 1 }) }], awbPolicies: [\n { policyId: \"neutral-priority\", intent: \"neutral-priority\", correctionStrength: fact(1) },\n ...(advancedPolicies ? [{ policyId: \"ambience\", intent: \"ambience-preserving\", correctionStrength: fact(.5) }] : [])], evidence, limitations });\n const metering = [{ kind: \"multi-zone-uniform\" }, ...(advancedPolicies ? [{ kind: \"highlight-weighted\", minimumWeightFraction: .2, exponent: 2 }] : [])]\n .map((policy): GenericVersionedAsset<ExposureMeteringProfile> => ({ assetId: id+\":meter:\"+policy.kind, assetVersion: version,\n profile: parseExposureMeteringProfile({ schemaVersion: \"0.1.0\", profileId: id+\":meter:\"+policy.kind, scientificStatus: \"approximation\",\n inputDomain: \"relative-pre-exposure-linear-signal\", captureRegion: \"oriented-active-capture\", policy,\n target: { kind: \"relative-signal-reference\", targetRelativeSignal: .18, evidence }, evidence,\n limitations: [...limitations, \"0.18 is a declared target policy, not universal scene/camera truth.\"] }) }));\n const meteringCapabilities = parseGenericBodyMeteringCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":metering-capabilities\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, supportedMeteringProfiles: metering.map((m) => ({ meteringProfileId: m.profile.profileId, policyKind: m.profile.policy.kind, evidence })),\n spotFocusPointLinkage: { availability: \"unsupported\", evidence } });\n const timingId = id+\":data-readout\";\n const fixedPatternNoise = parseSensorFixedPatternNoiseProfile({ schemaVersion: \"0.1.0\", profileId: id+\":fixed-pattern\",\n colorSamplingProfileId: \"photivra-generic-bayer\", scientificStatus: \"approximation\", sensorInstanceSeedUint32: sensor.instanceSeed,\n photoResponseNonUniformity: { relativeStandardDeviation: fact(sensor.prnu) }, darkSignalNonUniformity: { relativeStandardDeviation: fact(sensor.dsnu) },\n hotPixels: { siteFraction: fact(sensor.hotFraction), darkCurrentMultiplier: fact(sensor.hotMultiplier) },\n rowOffset: { rmsElectrons: fact(sensor.rowRms) }, columnOffset: { rmsElectrons: fact(sensor.columnRms) },\n patternDistribution: \"normal-factors-truncated-at-zero\", evidence,\n limitations: [...limitations, \"Synthetic fixed-pattern magnitudes for teaching; opt-in only and not a measured sensor population.\"] });\n return { exposure, iso, signalChain, readout, release, focus, stabilization, whiteBalance, metering, meteringCapabilities,\n readoutTiming: { assetId: timingId, assetVersion: version, profile: { readoutMode: \"global\", captureReadoutDurationSeconds: {\n value: dataReadoutSeconds, unit: \"s\", evidence } } },\n rollingReadoutTiming: { assetId: id+\":rolling-data-readout\", assetVersion: version, profile: { readoutMode: \"rolling\",\n captureReadoutDurationSeconds: { value: dataReadoutSeconds, unit: \"s\", evidence }, scanDirectionNative: fact(\"top-to-bottom\"),\n spatialSamplingSkewSeconds: { value: dataReadoutSeconds, unit: \"s\", evidence } } },\n fixedPatternNoise: { assetId: id+\":fixed-pattern\", assetVersion: version, profile: fixedPatternNoise },\n flashSync: parseFlashSyncCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":flash-sync\", profileVersion: version,\n captureModeId: \"native-still\", timingProfileId: timingId, supportedOrdinarySyncModes: [\"front-curtain\", \"rear-curtain\"],\n highSpeedSyncSupported: false, ordinarySyncRequiresWholeActiveFrameSimultaneouslyExposed: true, evidence, limitations }) };\n}\nfunction lensAssets(version: GenericTierPresetVersion, id: string, r: GenericTierLensAssets[\"matchedReference\"]): GenericTierLensAssets {\n return { form: \"prime\", exposure: parseGenericLensExposureCapabilityProfile({ schemaVersion: \"0.1.0\", profileId: id+\":exposure\", profileVersion: version,\n scientificStatus: \"approximation\", evidence, focalLengthMmRange: fact({ minimum: 50, maximum: 50 }), aperture: { widestAvailableFNumber: {\n kind: \"constant\", fNumber: fact(4) }, narrowestAvailableFNumber: fact(16), settingGrid: { kind: \"continuous-within-range\" } } }),\n matchedReference: r, profileReferences: [\"radial\", \"lateral-ca\", \"vignetting\", \"breathing\", \"transmission\", \"pupil\", \"stray\", \"correction\"]\n .map((role) => ({ profileId: id+\":\"+role, profileVersion: version })),\n limitations: [...limitations, \"Optical reference response is limited to 50 mm, f/4, focus 5 m and explicit field/defocus/wavelength slices; capabilities do not authorize extrapolation.\",\n \"The initial prime has no OIS; body stabilization is separate.\"] };\n}\nconst common = { focalLengthMm: 50 as const, aperture: 4 as const, focusDistanceM: 5 as const, wavelengthNm: 550 as const,\n normalizationRadiusMm: Math.hypot(18,12), correctionCaFraction: .8 };\nfunction buildGenericTierAssets(version: GenericTierPresetVersion): readonly GenericEquipmentTierPreset[] {\n return [\n { tier: \"consumer\", label: \"Consumer\", presetId: \"photivra-consumer\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-consumer-body\", 6400, 4, 8, { bitDepth: 12, blackLevelCode: 256, saturationElectrons: 20000,\n maximumAnalogGain: 32, lowGainReadNoise: 6, highGainReadNoise: 2.5, highGainFromIso: 800, highGainMaximumCharge: 6000,\n prnu: .01, dsnu: .3, hotFraction: 2e-4, hotMultiplier: 50, rowRms: .6, columnRms: .4, instanceSeed: 0x51ed270b }, .03, .35, .005, false, false),\n lens: lensAssets(version, \"photivra-consumer-prime\", { ...common, distortionK1: -.06, lateralCaK1Offset: .008, vignettingR2: -.5,\n breathingProjectionScale: 1.03, transmission: .75, correctionGainStrength: .8, ghostPowerFraction: .006, veilPowerFraction: .012,\n pupilAmplitudeByField: [disk, clipped, clippedMore], pupilOpdMicrometersByDefocus: [near, flat, far], pupilThroughputByField: [1,.85,.65] }),\n tradeoffs: [\"Limited continuous AF; heavier digital correction and edge pupil clipping in matched reference.\"] },\n { tier: \"prosumer\", label: \"Prosumer\", presetId: \"photivra-prosumer\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-prosumer-body\", 12800, 8, 16, { bitDepth: 14, blackLevelCode: 1024, saturationElectrons: 40000,\n maximumAnalogGain: 64, lowGainReadNoise: 3, highGainReadNoise: 1.4, highGainFromIso: 800, highGainMaximumCharge: 12000,\n prnu: .006, dsnu: .2, hotFraction: 1e-4, hotMultiplier: 40, rowRms: .3, columnRms: .2, instanceSeed: 0x2c1b3c6d }, .015, .65, .01, true, true),\n lens: lensAssets(version, \"photivra-prosumer-prime\", { ...common, distortionK1: -.025, lateralCaK1Offset: .004, vignettingR2: -.25,\n breathingProjectionScale: 1.015, transmission: .85, correctionGainStrength: .6, ghostPowerFraction: .003, veilPowerFraction: .006,\n pupilAmplitudeByField: [disk, disk, clipped], pupilOpdMicrometersByDefocus: [near.map((v)=>v*.7), flat, far.map((v)=>v*.7)], pupilThroughputByField: [1,.95,.85] }),\n tradeoffs: [\"Lower matched-reference peripheral gain/noise amplification than Professional; not universally inferior.\"] },\n { tier: \"professional\", label: \"Professional\", presetId: \"photivra-professional\", presetVersion: version, scientificStatus: \"approximation\", evidence,\n body: bodyAssets(version, \"photivra-professional-body\", 25600, 12, 24, { bitDepth: 14, blackLevelCode: 1024, saturationElectrons: 60000,\n maximumAnalogGain: 128, lowGainReadNoise: 2, highGainReadNoise: 1.1, highGainFromIso: 800, highGainMaximumCharge: 16000,\n prnu: .004, dsnu: .15, hotFraction: 5e-5, hotMultiplier: 30, rowRms: .15, columnRms: .1, instanceSeed: 0x6a09e667 }, .008, .85, .02, true, true),\n lens: lensAssets(version, \"photivra-professional-prime\", { ...common, distortionK1: -.01, lateralCaK1Offset: .002, vignettingR2: -.35,\n breathingProjectionScale: 1.005, transmission: .9, correctionGainStrength: .8, ghostPowerFraction: .001, veilPowerFraction: .002,\n pupilAmplitudeByField: [disk, disk, disk], pupilOpdMicrometersByDefocus: [near.map((v)=>v*.9), flat, far.map((v)=>v*.6)], pupilThroughputByField: [1,.98,.95] }),\n tradeoffs: [\"Less edge clipping/stray light, with greater f/4 falloff/gain cost than Prosumer and asymmetric near/far wavefront character.\"] }\n ];\n}\n\n/** The presets of the current version, 2.1.0 (third-stop ISO settings). */\nexport const GENERIC_TIER_ASSETS: readonly GenericEquipmentTierPreset[] = buildGenericTierAssets(\"2.1.0\");\nlet historical: readonly GenericEquipmentTierPreset[] | undefined;\n/** The presets of an exact version; 2.0.0 (whole-stop ISO) is built on first use. */\nexport function genericTierAssets(version: GenericTierPresetVersion): readonly GenericEquipmentTierPreset[] {\n if (version === \"2.1.0\") return GENERIC_TIER_ASSETS;\n return historical ??= buildGenericTierAssets(\"2.0.0\");\n}\n"]}
|