@photivra/engine 2.19.0 → 2.20.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 +112 -1
- package/CITATION.cff +1 -1
- package/NODE_SUPPORT.md +7 -5
- package/README.md +6 -6
- package/SECURITY.md +1 -1
- package/THIRD_PARTY.md +14 -10
- package/dist/capture/dng-lens-correction-opcodes.d.ts +32 -0
- package/dist/capture/dng-lens-correction-opcodes.js +119 -0
- package/dist/capture/dng-lens-correction-opcodes.js.map +1 -0
- package/dist/capture/native-environment-lean.js +1 -5
- package/dist/capture/native-environment-lean.js.map +1 -1
- package/dist/capture/native-raw-dng.d.ts +6 -0
- package/dist/capture/native-raw-dng.js +16 -2
- package/dist/capture/native-raw-dng.js.map +1 -1
- package/dist/capture/sensor-raw-producer.js +3 -5
- package/dist/capture/sensor-raw-producer.js.map +1 -1
- package/dist/core/shared-helpers.d.ts +2 -0
- package/dist/core/shared-helpers.js +4 -0
- package/dist/core/shared-helpers.js.map +1 -1
- 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 +8 -2
- package/dist/equipment/generic-lens-catalogue.js +31 -2
- package/dist/equipment/generic-lens-catalogue.js.map +1 -1
- package/dist/equipment/generic-tier-assets.js +2 -3
- package/dist/equipment/generic-tier-assets.js.map +1 -1
- package/dist/equipment/generic-tier-presets.js +2 -3
- package/dist/equipment/generic-tier-presets.js.map +1 -1
- package/dist/facade/display-view-gpu.d.ts +7 -4
- package/dist/facade/display-view-gpu.js +4 -4
- package/dist/facade/display-view-gpu.js.map +1 -1
- package/dist/facade/display-view-lens-signal.d.ts +1 -1
- package/dist/facade/display-view-lens-signal.js +5 -3
- package/dist/facade/display-view-lens-signal.js.map +1 -1
- package/dist/facade/display-view.d.ts +3 -1
- package/dist/facade/display-view.js +1 -1
- package/dist/facade/display-view.js.map +1 -1
- package/dist/facade/fast-methods.d.ts +50 -0
- package/dist/facade/fast-methods.js +50 -0
- package/dist/facade/fast-methods.js.map +1 -0
- package/dist/facade/fast-resolution.d.ts +12 -0
- package/dist/facade/fast-resolution.js +18 -0
- package/dist/facade/fast-resolution.js.map +1 -0
- package/dist/facade/generic-lens-capture.d.ts +3 -2
- package/dist/facade/generic-lens-capture.js +3 -2
- package/dist/facade/generic-lens-capture.js.map +1 -1
- package/dist/facade/simulate-capture.d.ts +51 -11
- package/dist/facade/simulate-capture.js +144 -75
- package/dist/facade/simulate-capture.js.map +1 -1
- package/dist/facade/simulate-display-view.d.ts +3 -2
- package/dist/facade/simulate-display-view.js +22 -12
- package/dist/facade/simulate-display-view.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/optics/aperture-diameter.d.ts +47 -0
- package/dist/optics/aperture-diameter.js +50 -0
- package/dist/optics/aperture-diameter.js.map +1 -0
- package/dist/optics/detail-limit.d.ts +182 -0
- package/dist/optics/detail-limit.js +336 -0
- package/dist/optics/detail-limit.js.map +1 -0
- package/dist/optics/generic-lens-psf.d.ts +18 -2
- package/dist/optics/generic-lens-psf.js +25 -2
- package/dist/optics/generic-lens-psf.js.map +1 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts +13 -0
- package/dist/optics/scene-to-sensor-irradiance.js +7 -0
- package/dist/optics/scene-to-sensor-irradiance.js.map +1 -1
- package/dist/output/crop-to-match-focal-length.d.ts +62 -0
- package/dist/output/crop-to-match-focal-length.js +63 -0
- package/dist/output/crop-to-match-focal-length.js.map +1 -0
- package/dist/output/developed-lens-corrections.js +2 -2
- package/dist/output/developed-lens-corrections.js.map +1 -1
- package/dist/output/generic-lens-corrections.d.ts +3 -1
- package/dist/output/generic-lens-corrections.js +8 -4
- package/dist/output/generic-lens-corrections.js.map +1 -1
- package/dist/output/lens-corrections.d.ts +12 -2
- package/dist/output/lens-corrections.js +22 -7
- package/dist/output/lens-corrections.js.map +1 -1
- package/dist/output/print-contrast-reference.js +1 -1
- package/dist/output/print-contrast-reference.js.map +1 -1
- package/dist/output/print-size-blur-noise.d.ts +110 -0
- package/dist/output/print-size-blur-noise.js +138 -0
- package/dist/output/print-size-blur-noise.js.map +1 -0
- package/dist/sensor/eqe-electron-rate.js +1 -7
- package/dist/sensor/eqe-electron-rate.js.map +1 -1
- package/dist/sensor/exposure-window.d.ts +2 -0
- package/dist/sensor/exposure-window.js +2 -2
- package/dist/sensor/exposure-window.js.map +1 -1
- package/dist/sensor/readout-timing.js +2 -23
- package/dist/sensor/readout-timing.js.map +1 -1
- package/dist/sensor/response-application-compatibility.js +1 -6
- package/dist/sensor/response-application-compatibility.js.map +1 -1
- package/dist/sensor/responsivity-photocurrent.js +1 -7
- package/dist/sensor/responsivity-photocurrent.js.map +1 -1
- package/dist/sensor/sensor-characteristics.d.ts +137 -0
- package/dist/sensor/sensor-characteristics.js +115 -0
- package/dist/sensor/sensor-characteristics.js.map +1 -0
- package/dist/sensor/spatial-sample-reduction.js +1 -5
- package/dist/sensor/spatial-sample-reduction.js.map +1 -1
- package/dist/sensor/spectral-quadrature.js +1 -6
- package/dist/sensor/spectral-quadrature.js.map +1 -1
- package/dist/sensor/temporal-photo-signal.d.ts +3 -0
- package/dist/sensor/temporal-photo-signal.js +5 -2
- package/dist/sensor/temporal-photo-signal.js.map +1 -1
- package/dist/stabilization/system.d.ts +9 -0
- package/dist/stabilization/system.js +5 -6
- package/dist/stabilization/system.js.map +1 -1
- package/docs/AGENT_GUIDE.md +4 -0
- package/docs/API_REFERENCE.md +76 -2
- package/docs/QUICK_START.md +88 -6
- package/docs/USAGE.md +65 -2
- package/docs/api/capture-native-raw-dng.md +6 -0
- package/docs/api/core-version.md +1 -1
- package/docs/api/equipment-generic-lens-catalogue.md +7 -2
- package/docs/api/exports.json +152 -2
- package/docs/api/facade-display-view-gpu.md +5 -2
- package/docs/api/facade-fast-methods.md +91 -0
- package/docs/api/facade-simulate-capture.md +36 -11
- package/docs/api/facade-simulate-display-view.md +3 -2
- package/docs/api/optics-aperture-diameter.md +51 -0
- package/docs/api/optics-detail-limit.md +203 -0
- package/docs/api/output-crop-to-match-focal-length.md +67 -0
- package/docs/api/output-generic-lens-corrections.md +3 -1
- package/docs/api/output-lens-corrections.md +11 -1
- package/docs/api/output-print-size-blur-noise.md +115 -0
- package/docs/api/sensor-sensor-characteristics.md +105 -0
- package/llms.txt +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registry of every speed-versus-accuracy choice (#395, owner rule of 2.20.0): one entry per choice that has a fast and an
|
|
3
|
+
* exact (full) method, and per option record that accepts `fast` without a fast method yet. Every entry resolves through
|
|
4
|
+
* `resolveFast` and `fastFormatDefault` (fast-resolution.ts): an option record's `fast`, else the top-level `fast`, else the
|
|
5
|
+
* format default (fast for "srgb-8", "srgb-16" and the display view; exact for "dng", "jpeg", "png" and `simulateIdealReference`).
|
|
6
|
+
*
|
|
7
|
+
* Data only (a root export, so developers can read which choices exist), read by `test/fast-methods-registry.test.ts`, which
|
|
8
|
+
* fails when an option accepts `fast` without an entry here, an entry lacks its resolver or its report, or a format's default
|
|
9
|
+
* leaves the rule. Captures and display views do not import this module (tree-shaking leaves it out of their bundles). A new
|
|
10
|
+
* fast method adds its entry here and to docs/API_STYLE.md, "Exact and fast modes".
|
|
11
|
+
* @see docs/API_STYLE.md, "Exact and fast modes".
|
|
12
|
+
*/
|
|
13
|
+
/** One speed-versus-accuracy choice of {@link SIMULATE_CAPTURE_FAST_METHODS} (2.20.0). */
|
|
14
|
+
export interface SimulateCaptureFastMethod {
|
|
15
|
+
/** A short id: the option path and, where one option has several fast methods, the method. */
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* The request path whose record takes the `fast` override (`allowKeys` path in simulate-capture.ts), or "fast" when only the
|
|
19
|
+
* top-level flag sets it (a choice with no option record of its own).
|
|
20
|
+
*/
|
|
21
|
+
override: string;
|
|
22
|
+
/** "fast-and-exact": both methods exist; "exact-only": the record takes `fast`, but there is no fast method yet (reports false). */
|
|
23
|
+
methods: "fast-and-exact" | "exact-only";
|
|
24
|
+
/** Where it applies. */
|
|
25
|
+
runs: readonly ("simulateCapture" | "simulateDisplayView" | "prepareDisplayView")[];
|
|
26
|
+
/** The fast method and the exact one, in words (empty for exact-only). */
|
|
27
|
+
fast: string;
|
|
28
|
+
exact: string;
|
|
29
|
+
/** Always true: no choice keeps its own default (the test checks it). */
|
|
30
|
+
followsFormatDefault: true;
|
|
31
|
+
/**
|
|
32
|
+
* The resolver call in the source (`resolveFast(<record flag>, fastTop)`, or `fastTop` itself for a top-level choice), which the
|
|
33
|
+
* test finds in the named file.
|
|
34
|
+
*/
|
|
35
|
+
resolver: {
|
|
36
|
+
file: string;
|
|
37
|
+
call: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* How the result reports it: the `diagnostics.fast.applied` key (true where the fast method ran), an assumption id the fast
|
|
41
|
+
* method adds, or another result field. At least one; the test finds each assumption id in the source.
|
|
42
|
+
*/
|
|
43
|
+
report: {
|
|
44
|
+
applied?: string;
|
|
45
|
+
assumption?: string;
|
|
46
|
+
field?: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** 2.20.0: every speed-versus-accuracy choice of the capture facade and the display view (see the module comment). */
|
|
50
|
+
export declare const SIMULATE_CAPTURE_FAST_METHODS: readonly SimulateCaptureFastMethod[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
const CAPTURE = "src/facade/simulate-capture.ts", VIEW = "src/facade/simulate-display-view.ts";
|
|
3
|
+
/** 2.20.0: every speed-versus-accuracy choice of the capture facade and the display view (see the module comment). */
|
|
4
|
+
export const SIMULATE_CAPTURE_FAST_METHODS = /* @__PURE__ */ Object.freeze([
|
|
5
|
+
{ id: "lens.catalogue/field-grid", override: "lens.catalogue", methods: "fast-and-exact", runs: ["simulateCapture"],
|
|
6
|
+
fast: "#568: the PSF blended over a field grid and tabulated expected electrons, verified per CFA phase against the exact chain",
|
|
7
|
+
exact: "the environment PSF quadrature with the PSF resolved at each query point", followsFormatDefault: true,
|
|
8
|
+
resolver: { file: CAPTURE, call: "resolveFast(catalogueFast, fastTop)" }, report: { applied: "lens.catalogue", assumption: "fast.lens.catalogue" } },
|
|
9
|
+
{ id: "lens.catalogue/cats-eye", override: "lens.catalogue", methods: "fast-and-exact", runs: ["simulateCapture", "simulateDisplayView", "prepareDisplayView"],
|
|
10
|
+
fast: "#567: with lens.defocus, the lens's bokeh without its cat's eye (the axis kernel everywhere)",
|
|
11
|
+
exact: "the cat's eye shaped at each field point (fast wides and normals)", followsFormatDefault: true,
|
|
12
|
+
resolver: { file: CAPTURE, call: "resolveFast(catalogueFast, fastTop)" }, report: { applied: "lens.catalogue", assumption: "fast.lens.catalogue.catsEye" } },
|
|
13
|
+
{ id: "lens.catalogue/view-psf-zones", override: "lens.catalogue", methods: "fast-and-exact", runs: ["simulateDisplayView", "prepareDisplayView"],
|
|
14
|
+
fast: "#569 (H1): 64 field zones along the longer side, each with the PSF at its centre",
|
|
15
|
+
exact: "one zone per site: the PSF at each site centre", followsFormatDefault: true,
|
|
16
|
+
resolver: { file: CAPTURE, call: "resolveFast(catalogueFast, fastTop)" }, report: { applied: "lens.catalogue", assumption: "view.lensPsf" } },
|
|
17
|
+
{ id: "lens.diffraction/rolling-shutter-taps", override: "lens.diffraction", methods: "fast-and-exact", runs: ["simulateCapture"],
|
|
18
|
+
fast: "#565: under rolling-shutter rotation, each PSF tap reads the scene at its own source point",
|
|
19
|
+
exact: "each tap reads the scene at its site-lattice point (ties on chart boundaries resolve as on the lattice)", followsFormatDefault: true,
|
|
20
|
+
resolver: { file: CAPTURE, call: "resolveFast(diffractionFast, fastTop)" }, report: { applied: "lens.diffraction", assumption: "fast.lens.diffraction" } },
|
|
21
|
+
{ id: "output.demosaic.ahd/view-low-signal-correction", override: "output.demosaic", methods: "fast-and-exact", runs: ["simulateDisplayView", "prepareDisplayView"],
|
|
22
|
+
fast: "(H3) 2048 draws per correction state, applied where a pixel's linear noise exceeds 0.01",
|
|
23
|
+
exact: "8192 draws per state, at the same 0.01 threshold", followsFormatDefault: true,
|
|
24
|
+
resolver: { file: CAPTURE, call: "resolveFast(demosaicFast, fastTop)" }, report: { applied: "output.demosaic.ahd", assumption: "view.demosaic" } },
|
|
25
|
+
{ id: "view.uniform-pixel-sampling", override: "fast", methods: "fast-and-exact", runs: ["simulateDisplayView", "prepareDisplayView"],
|
|
26
|
+
fast: "(H2) a quarter of the samples per axis in display pixels whose pilot finds no detail",
|
|
27
|
+
exact: "the full samples per axis in every display pixel", followsFormatDefault: true,
|
|
28
|
+
resolver: { file: CAPTURE, call: "uniformSampling: fastTop" }, report: { assumption: "view.estimation" } },
|
|
29
|
+
{ id: "prepareDisplayView.gpu", override: "fast", methods: "fast-and-exact", runs: ["prepareDisplayView"],
|
|
30
|
+
fast: "gpu \"auto\": WebGPU float32 where a conforming device supports the request (a bounded approximation), else the CPU reference",
|
|
31
|
+
exact: "gpu \"off\": the CPU reference; an explicit gpu wins", followsFormatDefault: true,
|
|
32
|
+
resolver: { file: VIEW, call: "parsePrepareDisplayViewOptions(prepareOptions, (options as { fast?: unknown } | null | undefined)?.fast !== false)" },
|
|
33
|
+
report: { field: "diagnostics.fast.execution" } },
|
|
34
|
+
{ id: "sensor.midGrey", override: "fast", methods: "fast-and-exact", runs: ["simulateCapture", "simulateDisplayView", "prepareDisplayView"],
|
|
35
|
+
fast: "#535: the mid-gray noise figure is not computed (about 0.3 ms)", exact: "result.sensor.midGrey is computed", followsFormatDefault: true,
|
|
36
|
+
resolver: { file: CAPTURE, call: "fastTop ? undefined : 0" }, report: { field: "sensor.midGrey" } },
|
|
37
|
+
{ id: "lens.diffraction", override: "lens.diffraction", methods: "exact-only", runs: ["simulateCapture", "simulateDisplayView", "prepareDisplayView"],
|
|
38
|
+
fast: "", exact: "the diffraction kernels (a fast method only under rolling-shutter rotation, above)", followsFormatDefault: true,
|
|
39
|
+
resolver: { file: CAPTURE, call: "resolveFast(diffractionFast, fastTop)" }, report: { applied: "lens.diffraction" } },
|
|
40
|
+
{ id: "sensor.antiAliasing", override: "sensor.antiAliasing", methods: "exact-only", runs: ["simulateCapture", "simulateDisplayView", "prepareDisplayView"],
|
|
41
|
+
fast: "", exact: "the point-splitting filter", followsFormatDefault: true,
|
|
42
|
+
resolver: { file: CAPTURE, call: "fastInUse" }, report: { applied: "sensor.antiAliasing" } },
|
|
43
|
+
{ id: "sensor.pixelAperture.box", override: "sensor.pixelAperture", methods: "exact-only", runs: ["simulateCapture", "simulateDisplayView", "prepareDisplayView"],
|
|
44
|
+
fast: "", exact: "the N × N midpoint rule", followsFormatDefault: true,
|
|
45
|
+
resolver: { file: CAPTURE, call: "fastInUse" }, report: { applied: "sensor.pixelAperture.box" } },
|
|
46
|
+
{ id: "output.demosaic.ahd", override: "output.demosaic", methods: "exact-only", runs: ["simulateCapture"],
|
|
47
|
+
fast: "", exact: "the AHD demosaic of the capture (a fast method only in the display view's correction, above)", followsFormatDefault: true,
|
|
48
|
+
resolver: { file: CAPTURE, call: "resolveFast(demosaicFast, fastTop)" }, report: { applied: "output.demosaic.ahd" } }
|
|
49
|
+
]);
|
|
50
|
+
//# sourceMappingURL=fast-methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-methods.js","sourceRoot":"","sources":["../../src/facade/fast-methods.ts"],"names":[],"mappings":"AAAA,sCAAsC;AA6CtC,MAAM,OAAO,GAAG,gCAAgC,EAAE,IAAI,GAAG,qCAAqC,CAAC;AAE/F,sHAAsH;AACtH,MAAM,CAAC,MAAM,6BAA6B,GAAyC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/G,EAAE,EAAE,EAAE,2BAA2B,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,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oBAAoB,CAAC;QAC/J,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,IAAI;QACtE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE,EAAE;IACnG,EAAE,EAAE,EAAE,qBAAqB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,iBAAiB,CAAC;QACxG,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,8FAA8F,EAAE,oBAAoB,EAAE,IAAI;QAC3I,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,oCAAoC,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE;CAChE,CAAC,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The registry of every speed-versus-accuracy choice (#395, owner rule of 2.20.0): one entry per choice that has a fast and an\n * exact (full) method, and per option record that accepts `fast` without a fast method yet. Every entry resolves through\n * `resolveFast` and `fastFormatDefault` (fast-resolution.ts): an option record's `fast`, else the top-level `fast`, else the\n * format default (fast for \"srgb-8\", \"srgb-16\" and the display view; exact for \"dng\", \"jpeg\", \"png\" and `simulateIdealReference`).\n *\n * Data only (a root export, so developers can read which choices exist), read by `test/fast-methods-registry.test.ts`, which\n * fails when an option accepts `fast` without an entry here, an entry lacks its resolver or its report, or a format's default\n * leaves the rule. Captures and display views do not import this module (tree-shaking leaves it out of their bundles). A new\n * fast method adds its entry here and to docs/API_STYLE.md, \"Exact and fast modes\".\n * @see docs/API_STYLE.md, \"Exact and fast modes\".\n */\n\n/** One speed-versus-accuracy choice of {@link SIMULATE_CAPTURE_FAST_METHODS} (2.20.0). */\nexport interface SimulateCaptureFastMethod {\n /** A short id: the option path and, where one option has several fast methods, the method. */\n id: string;\n /**\n * The request path whose record takes the `fast` override (`allowKeys` path in simulate-capture.ts), or \"fast\" when only the\n * top-level flag sets it (a choice with no option record of its own).\n */\n override: string;\n /** \"fast-and-exact\": both methods exist; \"exact-only\": the record takes `fast`, but there is no fast method yet (reports false). */\n methods: \"fast-and-exact\" | \"exact-only\";\n /** Where it applies. */\n runs: readonly (\"simulateCapture\" | \"simulateDisplayView\" | \"prepareDisplayView\")[];\n /** The fast method and the exact one, in words (empty for exact-only). */\n fast: string;\n exact: string;\n /** Always true: no choice keeps its own default (the test checks it). */\n followsFormatDefault: true;\n /**\n * The resolver call in the source (`resolveFast(<record flag>, fastTop)`, or `fastTop` itself for a top-level choice), which the\n * test finds in the named file.\n */\n resolver: { file: string; call: string };\n /**\n * How the result reports it: the `diagnostics.fast.applied` key (true where the fast method ran), an assumption id the fast\n * method adds, or another result field. At least one; the test finds each assumption id in the source.\n */\n report: { applied?: string; assumption?: string; field?: string };\n}\n\nconst CAPTURE = \"src/facade/simulate-capture.ts\", VIEW = \"src/facade/simulate-display-view.ts\";\n\n/** 2.20.0: every speed-versus-accuracy choice of the capture facade and the display view (see the module comment). */\nexport const SIMULATE_CAPTURE_FAST_METHODS: readonly SimulateCaptureFastMethod[] = /* @__PURE__ */ Object.freeze([\n { id: \"lens.catalogue/field-grid\", override: \"lens.catalogue\", methods: \"fast-and-exact\", runs: [\"simulateCapture\"],\n fast: \"#568: the PSF blended over a field grid and tabulated expected electrons, verified per CFA phase against the exact chain\",\n exact: \"the environment PSF quadrature with the PSF resolved at each query point\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(catalogueFast, fastTop)\" }, report: { applied: \"lens.catalogue\", assumption: \"fast.lens.catalogue\" } },\n { id: \"lens.catalogue/cats-eye\", override: \"lens.catalogue\", methods: \"fast-and-exact\", runs: [\"simulateCapture\", \"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"#567: with lens.defocus, the lens's bokeh without its cat's eye (the axis kernel everywhere)\",\n exact: \"the cat's eye shaped at each field point (fast wides and normals)\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(catalogueFast, fastTop)\" }, report: { applied: \"lens.catalogue\", assumption: \"fast.lens.catalogue.catsEye\" } },\n { id: \"lens.catalogue/view-psf-zones\", override: \"lens.catalogue\", methods: \"fast-and-exact\", runs: [\"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"#569 (H1): 64 field zones along the longer side, each with the PSF at its centre\",\n exact: \"one zone per site: the PSF at each site centre\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(catalogueFast, fastTop)\" }, report: { applied: \"lens.catalogue\", assumption: \"view.lensPsf\" } },\n { id: \"lens.diffraction/rolling-shutter-taps\", override: \"lens.diffraction\", methods: \"fast-and-exact\", runs: [\"simulateCapture\"],\n fast: \"#565: under rolling-shutter rotation, each PSF tap reads the scene at its own source point\",\n exact: \"each tap reads the scene at its site-lattice point (ties on chart boundaries resolve as on the lattice)\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(diffractionFast, fastTop)\" }, report: { applied: \"lens.diffraction\", assumption: \"fast.lens.diffraction\" } },\n { id: \"output.demosaic.ahd/view-low-signal-correction\", override: \"output.demosaic\", methods: \"fast-and-exact\", runs: [\"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"(H3) 2048 draws per correction state, applied where a pixel's linear noise exceeds 0.01\",\n exact: \"8192 draws per state, at the same 0.01 threshold\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(demosaicFast, fastTop)\" }, report: { applied: \"output.demosaic.ahd\", assumption: \"view.demosaic\" } },\n { id: \"view.uniform-pixel-sampling\", override: \"fast\", methods: \"fast-and-exact\", runs: [\"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"(H2) a quarter of the samples per axis in display pixels whose pilot finds no detail\",\n exact: \"the full samples per axis in every display pixel\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"uniformSampling: fastTop\" }, report: { assumption: \"view.estimation\" } },\n { id: \"prepareDisplayView.gpu\", override: \"fast\", methods: \"fast-and-exact\", runs: [\"prepareDisplayView\"],\n fast: \"gpu \\\"auto\\\": WebGPU float32 where a conforming device supports the request (a bounded approximation), else the CPU reference\",\n exact: \"gpu \\\"off\\\": the CPU reference; an explicit gpu wins\", followsFormatDefault: true,\n resolver: { file: VIEW, call: \"parsePrepareDisplayViewOptions(prepareOptions, (options as { fast?: unknown } | null | undefined)?.fast !== false)\" },\n report: { field: \"diagnostics.fast.execution\" } },\n { id: \"sensor.midGrey\", override: \"fast\", methods: \"fast-and-exact\", runs: [\"simulateCapture\", \"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"#535: the mid-gray noise figure is not computed (about 0.3 ms)\", exact: \"result.sensor.midGrey is computed\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"fastTop ? undefined : 0\" }, report: { field: \"sensor.midGrey\" } },\n { id: \"lens.diffraction\", override: \"lens.diffraction\", methods: \"exact-only\", runs: [\"simulateCapture\", \"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"\", exact: \"the diffraction kernels (a fast method only under rolling-shutter rotation, above)\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(diffractionFast, fastTop)\" }, report: { applied: \"lens.diffraction\" } },\n { id: \"sensor.antiAliasing\", override: \"sensor.antiAliasing\", methods: \"exact-only\", runs: [\"simulateCapture\", \"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"\", exact: \"the point-splitting filter\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"fastInUse\" }, report: { applied: \"sensor.antiAliasing\" } },\n { id: \"sensor.pixelAperture.box\", override: \"sensor.pixelAperture\", methods: \"exact-only\", runs: [\"simulateCapture\", \"simulateDisplayView\", \"prepareDisplayView\"],\n fast: \"\", exact: \"the N × N midpoint rule\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"fastInUse\" }, report: { applied: \"sensor.pixelAperture.box\" } },\n { id: \"output.demosaic.ahd\", override: \"output.demosaic\", methods: \"exact-only\", runs: [\"simulateCapture\"],\n fast: \"\", exact: \"the AHD demosaic of the capture (a fast method only in the display view's correction, above)\", followsFormatDefault: true,\n resolver: { file: CAPTURE, call: \"resolveFast(demosaicFast, fastTop)\" }, report: { applied: \"output.demosaic.ahd\" } }\n] as const satisfies readonly SimulateCaptureFastMethod[]);\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one exact-or-fast resolver (#395, 2.20.0) that every speed-versus-accuracy choice of the capture facade and the display
|
|
3
|
+
* view goes through: an option record's `fast`, else the request's top-level `fast`, else the format default. The registry of
|
|
4
|
+
* the choices that use it is `fast-methods.ts` (not loaded by captures); docs/API_STYLE.md, "Exact and fast modes".
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The format default of the top-level `fast` (owner rule, 2.20.0): fast for the sRGB sample formats (`output.format` "srgb-8"
|
|
8
|
+
* and "srgb-16") and the display view; exact (full quality) for the exports ("dng", "jpeg", "png") and the ideal reference.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fastFormatDefault(format: string, run: "capture" | "display-view" | "ideal-reference"): boolean;
|
|
11
|
+
/** Record `fast` > top-level `fast` (already resolved against {@link fastFormatDefault}). */
|
|
12
|
+
export declare function resolveFast(record: boolean | undefined, top: boolean): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* The one exact-or-fast resolver (#395, 2.20.0) that every speed-versus-accuracy choice of the capture facade and the display
|
|
4
|
+
* view goes through: an option record's `fast`, else the request's top-level `fast`, else the format default. The registry of
|
|
5
|
+
* the choices that use it is `fast-methods.ts` (not loaded by captures); docs/API_STYLE.md, "Exact and fast modes".
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The format default of the top-level `fast` (owner rule, 2.20.0): fast for the sRGB sample formats (`output.format` "srgb-8"
|
|
9
|
+
* and "srgb-16") and the display view; exact (full quality) for the exports ("dng", "jpeg", "png") and the ideal reference.
|
|
10
|
+
*/
|
|
11
|
+
export function fastFormatDefault(format, run) {
|
|
12
|
+
return run === "display-view" || run !== "ideal-reference" && format.startsWith("srgb");
|
|
13
|
+
}
|
|
14
|
+
/** Record `fast` > top-level `fast` (already resolved against {@link fastFormatDefault}). */
|
|
15
|
+
export function resolveFast(record, top) {
|
|
16
|
+
return record ?? top;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=fast-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-resolution.js","sourceRoot":"","sources":["../../src/facade/fast-resolution.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,GAAmD;IACnG,OAAO,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,iBAAiB,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1F,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,WAAW,CAAC,MAA2B,EAAE,GAAY;IACnE,OAAO,MAAM,IAAI,GAAG,CAAC;AACvB,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The one exact-or-fast resolver (#395, 2.20.0) that every speed-versus-accuracy choice of the capture facade and the display\n * view goes through: an option record's `fast`, else the request's top-level `fast`, else the format default. The registry of\n * the choices that use it is `fast-methods.ts` (not loaded by captures); docs/API_STYLE.md, \"Exact and fast modes\".\n */\n\n/**\n * The format default of the top-level `fast` (owner rule, 2.20.0): fast for the sRGB sample formats (`output.format` \"srgb-8\"\n * and \"srgb-16\") and the display view; exact (full quality) for the exports (\"dng\", \"jpeg\", \"png\") and the ideal reference.\n */\nexport function fastFormatDefault(format: string, run: \"capture\" | \"display-view\" | \"ideal-reference\"): boolean {\n return run === \"display-view\" || run !== \"ideal-reference\" && format.startsWith(\"srgb\");\n}\n\n/** Record `fast` > top-level `fast` (already resolved against {@link fastFormatDefault}). */\nexport function resolveFast(record: boolean | undefined, top: boolean): boolean {\n return record ?? top;\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What `simulateCapture` needs for `lens.catalogue` (#549), loaded on demand: a capture without a catalogue lens (and a bundle
|
|
3
3
|
* that never asks for one) does not load the catalogue's data or its PSF builder. It also holds the developed-image lens
|
|
4
|
-
* corrections (`output.lensCorrections`, #570), which need a catalogue lens.
|
|
4
|
+
* corrections (`output.lensCorrections`, #570) and their DNG opcodes (`output.dng.lensCorrectionOpcodes`, #587), which need a catalogue lens.
|
|
5
5
|
*/
|
|
6
6
|
export { GENERIC_LENS_EVIDENCE, genericLensDispersion, genericLensDistortionProfile, genericLensVignettingProfile, resolveGenericLens, simulateGenericLensFocusError } from "../equipment/generic-lens-catalogue.js";
|
|
7
|
-
export { createGenericLensPsfProfile, genericLensPsfKernelRadius, GENERIC_LENS_PSF_MAXIMUM_COMBINED_RADIUS_SITES } from "../optics/generic-lens-psf.js";
|
|
7
|
+
export { createGenericLensPsfProfile, genericLensBokehKernel, genericLensPsfKernelRadius, GENERIC_LENS_PSF_MAXIMUM_COMBINED_RADIUS_SITES } from "../optics/generic-lens-psf.js";
|
|
8
8
|
export { CATALOGUE_FAST_VERIFICATION_TOLERANCE, catalogueFastAssumptions, createCatalogueLensSignal } from "./catalogue-lens-signal.js";
|
|
9
9
|
export { applyDevelopedLensCorrection, developedLensCorrectionSourceRect, prepareDevelopedLensCorrection } from "../output/developed-lens-corrections.js";
|
|
10
|
+
export { createDngLensCorrectionOpcodes } from "../capture/dng-lens-correction-opcodes.js";
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* What `simulateCapture` needs for `lens.catalogue` (#549), loaded on demand: a capture without a catalogue lens (and a bundle
|
|
4
4
|
* that never asks for one) does not load the catalogue's data or its PSF builder. It also holds the developed-image lens
|
|
5
|
-
* corrections (`output.lensCorrections`, #570), which need a catalogue lens.
|
|
5
|
+
* corrections (`output.lensCorrections`, #570) and their DNG opcodes (`output.dng.lensCorrectionOpcodes`, #587), which need a catalogue lens.
|
|
6
6
|
*/
|
|
7
7
|
export { GENERIC_LENS_EVIDENCE, genericLensDispersion, genericLensDistortionProfile, genericLensVignettingProfile, resolveGenericLens, simulateGenericLensFocusError } from "../equipment/generic-lens-catalogue.js";
|
|
8
|
-
export { createGenericLensPsfProfile, genericLensPsfKernelRadius, GENERIC_LENS_PSF_MAXIMUM_COMBINED_RADIUS_SITES } from "../optics/generic-lens-psf.js";
|
|
8
|
+
export { createGenericLensPsfProfile, genericLensBokehKernel, genericLensPsfKernelRadius, GENERIC_LENS_PSF_MAXIMUM_COMBINED_RADIUS_SITES } from "../optics/generic-lens-psf.js";
|
|
9
9
|
export { CATALOGUE_FAST_VERIFICATION_TOLERANCE, catalogueFastAssumptions, createCatalogueLensSignal } from "./catalogue-lens-signal.js";
|
|
10
10
|
export { applyDevelopedLensCorrection, developedLensCorrectionSourceRect, prepareDevelopedLensCorrection } from "../output/developed-lens-corrections.js";
|
|
11
|
+
export { createDngLensCorrectionOpcodes } from "../capture/dng-lens-correction-opcodes.js";
|
|
11
12
|
//# sourceMappingURL=generic-lens-capture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-lens-capture.js","sourceRoot":"","sources":["../../src/facade/generic-lens-capture.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;GAIG;AACH,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACrN,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,8CAA8C,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"generic-lens-capture.js","sourceRoot":"","sources":["../../src/facade/generic-lens-capture.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;GAIG;AACH,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACrN,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,8CAA8C,EAAE,MAAM,+BAA+B,CAAC;AAChL,OAAO,EAAE,qCAAqC,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACxI,OAAO,EAAE,4BAA4B,EAAE,iCAAiC,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAC1J,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * What `simulateCapture` needs for `lens.catalogue` (#549), loaded on demand: a capture without a catalogue lens (and a bundle\n * that never asks for one) does not load the catalogue's data or its PSF builder. It also holds the developed-image lens\n * corrections (`output.lensCorrections`, #570) and their DNG opcodes (`output.dng.lensCorrectionOpcodes`, #587), which need a catalogue lens.\n */\nexport { GENERIC_LENS_EVIDENCE, genericLensDispersion, genericLensDistortionProfile, genericLensVignettingProfile, resolveGenericLens, simulateGenericLensFocusError } from \"../equipment/generic-lens-catalogue.js\";\nexport { createGenericLensPsfProfile, genericLensBokehKernel, genericLensPsfKernelRadius, GENERIC_LENS_PSF_MAXIMUM_COMBINED_RADIUS_SITES } from \"../optics/generic-lens-psf.js\";\nexport { CATALOGUE_FAST_VERIFICATION_TOLERANCE, catalogueFastAssumptions, createCatalogueLensSignal } from \"./catalogue-lens-signal.js\";\nexport { applyDevelopedLensCorrection, developedLensCorrectionSourceRect, prepareDevelopedLensCorrection } from \"../output/developed-lens-corrections.js\";\nexport { createDngLensCorrectionOpcodes } from \"../capture/dng-lens-correction-opcodes.js\";\n"]}
|
|
@@ -25,6 +25,7 @@ import { type DefocusDiscSiteKernel, type ResolvedDefocusDisc } from "../optics/
|
|
|
25
25
|
import { type DefocusBokehOptions } from "../optics/defocus-bokeh-kernel.js";
|
|
26
26
|
import { type AntiAliasingPointSplitComponent } from "../sensor/optical-stack.js";
|
|
27
27
|
import { type NativeRawDng } from "../capture/native-raw-dng.js";
|
|
28
|
+
import { type SimulateCaptureSensorCharacteristics, type SimulateCaptureSensorReport } from "../sensor/sensor-characteristics.js";
|
|
28
29
|
import { type ChartScene, type ResolvedChartScene } from "./chart-scenes.js";
|
|
29
30
|
import { type ChartMaterialLayerScene, type ResolvedChartMaterialLayers } from "./chart-material-layers.js";
|
|
30
31
|
import { type ChartSizeOption, type CaptureIlluminant, type CallerMaterialScene, type CallerRadianceScene, type CallerReflectanceScene, type ResolvedCallerScene, type PlanarSceneRadianceProvider, type ResolvedCaptureIlluminant } from "./scene-radiance.js";
|
|
@@ -157,7 +158,12 @@ export type SimulateCaptureColorEncoding = "srgb" | "display-p3" | "rec2020";
|
|
|
157
158
|
* edge-directed method that reduces zipper and false colour on sharp edges.
|
|
158
159
|
*/
|
|
159
160
|
export type SimulateCaptureDemosaic = "bilinear" | "ahd";
|
|
160
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* `lens.catalogue` as a record (#568): the lens id as `kind` and the `fast` override (see {@link SimulateCaptureOptions.fast}).
|
|
163
|
+
* Fast: the tabulated fast method (#568), and with `lens.defocus` the lens's bokeh without its cat's eye (#567; fast wides and
|
|
164
|
+
* normals only), whose field-varying PSF needs a finer fast grid (measured 2.2–3.4× slower). Exact: the per-site PSF with the
|
|
165
|
+
* cat's eye. Blades and spherical aberration always apply (they cost nothing).
|
|
166
|
+
*/
|
|
161
167
|
export interface SimulateCaptureLensCatalogueRecord {
|
|
162
168
|
kind: string;
|
|
163
169
|
fast?: boolean;
|
|
@@ -186,6 +192,11 @@ export type SimulateCaptureLensDistortion = {
|
|
|
186
192
|
* accepted as a deprecated alias until 3.0.0, and giving both is an error.
|
|
187
193
|
*/
|
|
188
194
|
export type SimulateCaptureLensDiffraction = "circular-aperture" | {
|
|
195
|
+
/**
|
|
196
|
+
* #565: in focus with camera rotation and `motion.shutter: "rolling"`, exact reads each PSF tap's scene point at its
|
|
197
|
+
* site-lattice point, as every other path does, so a tap exactly on a chart boundary resolves as on the lattice (about 1.2×
|
|
198
|
+
* the time); fast keeps each tap's own point, which can resolve such a tie to the other material (docs/QUICK_START.md, "Optics").
|
|
199
|
+
*/
|
|
189
200
|
kind: "circular-aperture";
|
|
190
201
|
kernelRadiusSamples?: number;
|
|
191
202
|
fast?: boolean;
|
|
@@ -340,9 +351,9 @@ export interface SimulateCaptureOptions {
|
|
|
340
351
|
* factor and it replaces the tier lens's focal length and f-number range (the transmission is kept). The capture renders the
|
|
341
352
|
* lens's character, all labelled approximations: its PSF (diffraction with the lens's Seidel aberrations, axial and lateral
|
|
342
353
|
* colour, at the resolved f-number and focus) through the environment PSF quadrature, its radial distortion, its vignetting
|
|
343
|
-
* and, for the fisheyes, the equisolid projection. Flare
|
|
354
|
+
* and, for the fisheyes, the equisolid projection. Flare and focus breathing are not rendered. Not combinable
|
|
344
355
|
* with `prime`, `focalLengthMm`, `projection`, `distortion`, `vignetting`, `psf`, `diffraction` or `pupilSampling` (the
|
|
345
|
-
* lens sets them); `defocus` convolves the
|
|
356
|
+
* lens sets them); `defocus` convolves the lens's bokeh kernel (#567) into its PSF. The display view renders it with the PSF taken per field zone (#569; docs/DISPLAY_VIEW.md). Default off.
|
|
346
357
|
* #568: the record form `{ kind: <lens id>, fast }` overrides the top-level `fast` flag for this option; the fast method
|
|
347
358
|
* blends the PSF between exactly resolved kernels on a field grid and tabulates each site's expected signal
|
|
348
359
|
* (docs/LENS_CATALOGUE.md, "Fast method").
|
|
@@ -498,7 +509,7 @@ export interface SimulateCaptureOptions {
|
|
|
498
509
|
exposureCompensationStops?: number;
|
|
499
510
|
/** Default "scene-illuminant". */
|
|
500
511
|
whiteBalance?: SimulateCaptureWhiteBalance;
|
|
501
|
-
/** JPEG constant quantization step 1-255 (not a manufacturer 'quality'). Default 2. */
|
|
512
|
+
/** JPEG constant quantization step 1-255 (not a manufacturer 'quality'). Default 1 (2.20.0; 2 before), the full-quality export. */
|
|
502
513
|
jpegQuantizationStep?: number;
|
|
503
514
|
/** PNG only. Default "srgb". */
|
|
504
515
|
colorEncoding?: SimulateCaptureColorEncoding;
|
|
@@ -513,9 +524,15 @@ export interface SimulateCaptureOptions {
|
|
|
513
524
|
demosaic?: SimulateCaptureDemosaic | SimulateCaptureDemosaicRecord;
|
|
514
525
|
/** Default "margin". */
|
|
515
526
|
borderHandling?: SimulateCaptureBorderHandling;
|
|
516
|
-
/**
|
|
527
|
+
/**
|
|
528
|
+
* DNG only: optional capture-event time (YYYY-MM-DDTHH:mm:ss.sssZ); without it no date tags are written. Opt-in (#587), with
|
|
529
|
+
* `lens.catalogue`: `lensCorrectionOpcodes` writes the selected corrections of {@link SimulateCaptureLensCorrections} into the DNG as
|
|
530
|
+
* optional DNG opcodes in OpcodeList3 (FixVignetteRadial, WarpRectilinear with the zoom-to-fill; docs/NATIVE_RAW_AND_PRINT.md), for RAW editors
|
|
531
|
+
* that apply them; the RAW codes are unchanged. Whole frame only (no `region`). All off (or omitted): the same DNG bytes as without it.
|
|
532
|
+
*/
|
|
517
533
|
dng?: {
|
|
518
534
|
capturedAtUtc?: string;
|
|
535
|
+
lensCorrectionOpcodes?: SimulateCaptureLensCorrections;
|
|
519
536
|
};
|
|
520
537
|
/**
|
|
521
538
|
* Opt-in (2.4) text written into the file for formats "jpeg", "png" and "dng": the caller's description,
|
|
@@ -573,7 +590,8 @@ export interface SimulateCaptureOptions {
|
|
|
573
590
|
};
|
|
574
591
|
/** Camera motion and shutter type. Default: still camera, global electronic shutter. */
|
|
575
592
|
motion?: SimulateCaptureMotion;
|
|
576
|
-
sensor
|
|
593
|
+
/** #555: plus the sensor characteristics ({@link SimulateCaptureSensorCharacteristics}), each off by default. */
|
|
594
|
+
sensor?: SimulateCaptureSensorCharacteristics & {
|
|
577
595
|
/**
|
|
578
596
|
* Pixel pitch in micrometres, 0.5–1000. Default 6. The simulated sensor is output width × pitch wide. 2.5: above 100 µm the
|
|
579
597
|
* capture is a downsized view of a whole frame (for example 36 mm / 48 pixels = 750 µm), recorded in the assumption
|
|
@@ -600,10 +618,14 @@ export interface SimulateCaptureOptions {
|
|
|
600
618
|
pixelAperture?: SimulateCapturePixelAperture;
|
|
601
619
|
};
|
|
602
620
|
/**
|
|
603
|
-
* Exact or fast (#395). `false
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
621
|
+
* Exact or fast (#395). `false`: every option runs its exact method, the engine reference. `true`: each option listed in
|
|
622
|
+
* {@link SIMULATE_CAPTURE_FAST_OPTIONS} runs its fast method where it has one, a measured, bounded approximation of the exact
|
|
623
|
+
* one; an option without a fast method runs exact. An option's own record `fast` overrides this for that option only.
|
|
624
|
+
* Omitted (2.20.0), the format decides: fast for `output.format` "srgb-8" and "srgb-16" and for the display view, exact for
|
|
625
|
+
* "dng", "jpeg" and "png" (exports) and for `simulateIdealReference`. `diagnostics.fast` reports the resolved value, where it
|
|
626
|
+
* came from and what ran. Fast methods: `lens.catalogue` (#568, #567) and `lens.diffraction` under rolling-shutter rotation
|
|
627
|
+
* (#565); in the display view also its catalogue PSF zones, its sampling of uniform pixels and its AHD low-signal correction
|
|
628
|
+
* (docs/DISPLAY_VIEW.md). The exact result also carries `result.sensor.midGrey` (#535). Calculators should pass `fast: false`.
|
|
607
629
|
*/
|
|
608
630
|
fast?: boolean;
|
|
609
631
|
/** Aborting cancels the running task; the promise rejects with a domain error and returns no partial image. */
|
|
@@ -626,8 +648,10 @@ export declare const SIMULATE_CAPTURE_FAST_OPTIONS: readonly ["lens.diffraction"
|
|
|
626
648
|
export type SimulateCaptureFastOption = typeof SIMULATE_CAPTURE_FAST_OPTIONS[number];
|
|
627
649
|
/** `diagnostics.fast` of a capture or display view (#395): what was asked for and what ran. */
|
|
628
650
|
export interface SimulateCaptureFastReport {
|
|
629
|
-
/**
|
|
651
|
+
/** 2.20.0: the resolved top-level value (`fast`, else the format default), or true when any option's record sets `fast: true`. */
|
|
630
652
|
requested: boolean;
|
|
653
|
+
/** 2.20.0: where the top-level value came from: the request's `fast`, or the format default (see {@link SimulateCaptureOptions.fast}). */
|
|
654
|
+
defaultedFrom: "request" | "format";
|
|
631
655
|
/** Each fast-capable option that ran, in {@link SIMULATE_CAPTURE_FAST_OPTIONS} order: true where its fast method ran. */
|
|
632
656
|
applied: Readonly<Partial<Record<SimulateCaptureFastOption, boolean>>>;
|
|
633
657
|
/** `engine-reference` when every option ran exact; `approximation-with-a-priori-bound` when any fast method ran (the WebGPU execution record's values). */
|
|
@@ -853,6 +877,8 @@ export interface SimulateCaptureResult {
|
|
|
853
877
|
limitations: readonly string[];
|
|
854
878
|
};
|
|
855
879
|
assumptions: readonly SimulateCaptureAssumption[];
|
|
880
|
+
/** #555, #535: the sensor characteristics used, the calculated dynamic range and (when the request resolves to exact) the mid-grey noise figure. */
|
|
881
|
+
sensor: SimulateCaptureSensorReport;
|
|
856
882
|
}
|
|
857
883
|
export declare const FACADE_EVIDENCE: readonly EvidenceProvenance[];
|
|
858
884
|
/**
|
|
@@ -902,6 +928,12 @@ export interface SimulateCaptureDngPart {
|
|
|
902
928
|
height: number;
|
|
903
929
|
};
|
|
904
930
|
};
|
|
931
|
+
/**
|
|
932
|
+
* 2.20.0: true when a fast method ran for this part (`Object.values(result.diagnostics.fast.applied).includes(true)`). The join
|
|
933
|
+
* refuses such a part unless its own request resolves to fast too (a DNG, JPEG or PNG is exact by default): render the parts with
|
|
934
|
+
* the same `fast` as the join, or with `fast: false`.
|
|
935
|
+
*/
|
|
936
|
+
fast?: boolean;
|
|
905
937
|
}
|
|
906
938
|
/**
|
|
907
939
|
* Writes the whole-frame DNG of `options` (`output.format: "dng"`, no `output.region`) from the packed RAW of region renders of
|
|
@@ -1056,6 +1088,8 @@ export interface DisplayViewResult {
|
|
|
1056
1088
|
autoIso?: SimulateCaptureAutoIsoReport;
|
|
1057
1089
|
};
|
|
1058
1090
|
scene: SimulateCaptureResult["scene"];
|
|
1091
|
+
/** #555, #535: as in the capture result. */
|
|
1092
|
+
sensor: SimulateCaptureSensorReport;
|
|
1059
1093
|
/**
|
|
1060
1094
|
* Work done: real pixels sampled, real-site expectations evaluated, scene queries, display pixels sampled in full (detail) or with
|
|
1061
1095
|
* a quarter of the samples per axis (uniform), display pixels whose value includes the AHD low-signal correction, and wall-clock
|
|
@@ -1194,6 +1228,12 @@ export interface DisplayViewRunContext {
|
|
|
1194
1228
|
readoutProfile: ReadoutProfile;
|
|
1195
1229
|
regimeId: string;
|
|
1196
1230
|
}>;
|
|
1231
|
+
sensor: SimulateCaptureSensorReport;
|
|
1232
|
+
/** 2.20.0: the view's own fast methods, resolved: the AHD low-signal correction's draws and threshold (`output.demosaic.ahd`) and the quarter sampling of uniform pixels (top-level `fast`). */
|
|
1233
|
+
viewFast: {
|
|
1234
|
+
ahd: boolean;
|
|
1235
|
+
uniformSampling: boolean;
|
|
1236
|
+
};
|
|
1197
1237
|
resolvedIso: number;
|
|
1198
1238
|
/** #516: how the ISO was chosen, reported in the view's `exposure`. */
|
|
1199
1239
|
isoReport: {
|