@photivra/engine 2.21.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.
Files changed (169) hide show
  1. package/CHANGELOG.md +118 -1
  2. package/CITATION.cff +1 -1
  3. package/README.md +6 -6
  4. package/SECURITY.md +1 -1
  5. package/THIRD_PARTY.md +11 -0
  6. package/dist/capture/c2pa-embed.d.ts +116 -0
  7. package/dist/capture/c2pa-embed.js +493 -0
  8. package/dist/capture/c2pa-embed.js.map +1 -0
  9. package/dist/capture/dng-import.d.ts +73 -8
  10. package/dist/capture/dng-import.js +315 -80
  11. package/dist/capture/dng-import.js.map +1 -1
  12. package/dist/capture/dng-opcodes.d.ts +96 -0
  13. package/dist/capture/dng-opcodes.js +391 -0
  14. package/dist/capture/dng-opcodes.js.map +1 -0
  15. package/dist/capture/dng-profile-maps.d.ts +99 -0
  16. package/dist/capture/dng-profile-maps.js +381 -0
  17. package/dist/capture/dng-profile-maps.js.map +1 -0
  18. package/dist/capture/dng-stage-image.d.ts +23 -0
  19. package/dist/capture/dng-stage-image.js +65 -0
  20. package/dist/capture/dng-stage-image.js.map +1 -0
  21. package/dist/capture/jpeg-xl-tiles.d.ts +22 -0
  22. package/dist/capture/jpeg-xl-tiles.js +151 -0
  23. package/dist/capture/jpeg-xl-tiles.js.map +1 -0
  24. package/dist/capture/lossy-jpeg.d.ts +17 -0
  25. package/dist/capture/lossy-jpeg.js +369 -0
  26. package/dist/capture/lossy-jpeg.js.map +1 -0
  27. package/dist/capture/native-raw-development.d.ts +2 -1
  28. package/dist/capture/native-raw-development.js.map +1 -1
  29. package/dist/color/neighbor-highlight-reconstruction.d.ts +66 -0
  30. package/dist/color/neighbor-highlight-reconstruction.js +234 -0
  31. package/dist/color/neighbor-highlight-reconstruction.js.map +1 -0
  32. package/dist/color/sensor-color-development.d.ts +5 -0
  33. package/dist/color/sensor-color-development.js +7 -1
  34. package/dist/color/sensor-color-development.js.map +1 -1
  35. package/dist/color/spectral-spikiness.d.ts +11 -0
  36. package/dist/color/spectral-spikiness.js +23 -0
  37. package/dist/color/spectral-spikiness.js.map +1 -0
  38. package/dist/core/execution-error.d.ts +21 -0
  39. package/dist/core/execution-error.js +12 -0
  40. package/dist/core/execution-error.js.map +1 -0
  41. package/dist/core/version.d.ts +1 -1
  42. package/dist/core/version.js +1 -1
  43. package/dist/core/version.js.map +1 -1
  44. package/dist/facade/catalogue-lens-signal.d.ts +26 -1
  45. package/dist/facade/catalogue-lens-signal.js +25 -7
  46. package/dist/facade/catalogue-lens-signal.js.map +1 -1
  47. package/dist/facade/diffraction-provider.d.ts +1 -1
  48. package/dist/facade/diffraction-provider.js +4 -4
  49. package/dist/facade/diffraction-provider.js.map +1 -1
  50. package/dist/facade/display-view-gpu-session.js +38 -6
  51. package/dist/facade/display-view-gpu-session.js.map +1 -1
  52. package/dist/facade/display-view-gpu.d.ts +13 -5
  53. package/dist/facade/display-view-gpu.js.map +1 -1
  54. package/dist/facade/display-view-normal.d.ts +15 -0
  55. package/dist/facade/display-view-normal.js +44 -0
  56. package/dist/facade/display-view-normal.js.map +1 -0
  57. package/dist/facade/display-view-rendering.d.ts +97 -0
  58. package/dist/facade/display-view-rendering.js +598 -0
  59. package/dist/facade/display-view-rendering.js.map +1 -0
  60. package/dist/facade/display-view.d.ts +37 -65
  61. package/dist/facade/display-view.js +147 -476
  62. package/dist/facade/display-view.js.map +1 -1
  63. package/dist/facade/expected-signal-setup.js +2 -2
  64. package/dist/facade/expected-signal-setup.js.map +1 -1
  65. package/dist/facade/fast-methods.d.ts +1 -1
  66. package/dist/facade/fast-methods.js +37 -8
  67. package/dist/facade/fast-methods.js.map +1 -1
  68. package/dist/facade/generic-lens-capture.d.ts +1 -1
  69. package/dist/facade/generic-lens-capture.js +1 -1
  70. package/dist/facade/generic-lens-capture.js.map +1 -1
  71. package/dist/facade/image-plane.js +41 -10
  72. package/dist/facade/image-plane.js.map +1 -1
  73. package/dist/facade/on-demand-kits.d.ts +14 -0
  74. package/dist/facade/on-demand-kits.js +36 -0
  75. package/dist/facade/on-demand-kits.js.map +1 -0
  76. package/dist/facade/opt-in-kit.d.ts +9 -0
  77. package/dist/facade/opt-in-kit.js +11 -0
  78. package/dist/facade/opt-in-kit.js.map +1 -0
  79. package/dist/facade/quality-kit.d.ts +21 -0
  80. package/dist/facade/quality-kit.js +23 -0
  81. package/dist/facade/quality-kit.js.map +1 -0
  82. package/dist/facade/quality-paths.d.ts +22 -0
  83. package/dist/facade/quality-paths.js +44 -0
  84. package/dist/facade/quality-paths.js.map +1 -0
  85. package/dist/facade/scene-radiance.d.ts +18 -2
  86. package/dist/facade/scene-radiance.js +6 -4
  87. package/dist/facade/scene-radiance.js.map +1 -1
  88. package/dist/facade/simulate-capture.d.ts +32 -13
  89. package/dist/facade/simulate-capture.js +162 -69
  90. package/dist/facade/simulate-capture.js.map +1 -1
  91. package/dist/facade/simulate-display-view.d.ts +10 -12
  92. package/dist/facade/simulate-display-view.js +57 -48
  93. package/dist/facade/simulate-display-view.js.map +1 -1
  94. package/dist/gpu/display-view-gpu-renderer.d.ts +43 -0
  95. package/dist/gpu/display-view-gpu-renderer.js +134 -0
  96. package/dist/gpu/display-view-gpu-renderer.js.map +1 -0
  97. package/dist/gpu/display-view-image-material-module.d.ts +3 -2
  98. package/dist/gpu/display-view-image-material-module.js +25 -3
  99. package/dist/gpu/display-view-image-material-module.js.map +1 -1
  100. package/dist/gpu/display-view-image-quality.d.ts +43 -1
  101. package/dist/gpu/display-view-image-quality.js +256 -11
  102. package/dist/gpu/display-view-image-quality.js.map +1 -1
  103. package/dist/gpu/display-view-quality-gpu.d.ts +13 -64
  104. package/dist/gpu/display-view-quality-gpu.js +60 -249
  105. package/dist/gpu/display-view-quality-gpu.js.map +1 -1
  106. package/dist/gpu/display-view-speed-gpu.d.ts +16 -16
  107. package/dist/gpu/display-view-speed-gpu.js +50 -12
  108. package/dist/gpu/display-view-speed-gpu.js.map +1 -1
  109. package/dist/gpu/image-kernel-accelerator.js +3 -0
  110. package/dist/gpu/image-kernel-accelerator.js.map +1 -1
  111. package/dist/gpu/image-kernel-execution.d.ts +2 -13
  112. package/dist/gpu/image-kernel-execution.js +2 -10
  113. package/dist/gpu/image-kernel-execution.js.map +1 -1
  114. package/dist/gpu/wgsl-display-view-coupled-stub.d.ts +8 -0
  115. package/dist/gpu/wgsl-display-view-coupled-stub.js +21 -0
  116. package/dist/gpu/wgsl-display-view-coupled-stub.js.map +1 -0
  117. package/dist/gpu/wgsl-display-view-coupled.d.ts +88 -0
  118. package/dist/gpu/wgsl-display-view-coupled.js +353 -0
  119. package/dist/gpu/wgsl-display-view-coupled.js.map +1 -0
  120. package/dist/gpu/wgsl-display-view-quality-kernel.d.ts +4 -9
  121. package/dist/gpu/wgsl-display-view-quality-kernel.js +109 -111
  122. package/dist/gpu/wgsl-display-view-quality-kernel.js.map +1 -1
  123. package/dist/gpu/wgsl-display-view-speed-kernel.d.ts +1 -41
  124. package/dist/gpu/wgsl-display-view-speed-kernel.js +71 -8
  125. package/dist/gpu/wgsl-display-view-speed-kernel.js.map +1 -1
  126. package/dist/index.d.ts +11 -3
  127. package/dist/index.js +9 -1
  128. package/dist/index.js.map +1 -1
  129. package/dist/output/camera-channel-response.d.ts +50 -0
  130. package/dist/output/camera-channel-response.js +69 -0
  131. package/dist/output/camera-channel-response.js.map +1 -0
  132. package/dist/output/native-capture-sdr.js +5 -2
  133. package/dist/output/native-capture-sdr.js.map +1 -1
  134. package/dist/output/sdr-rendering.d.ts +18 -1
  135. package/dist/output/sdr-rendering.js +39 -2
  136. package/dist/output/sdr-rendering.js.map +1 -1
  137. package/dist/sensor/native-sensor-report.d.ts +10 -0
  138. package/dist/sensor/native-sensor-report.js +16 -0
  139. package/dist/sensor/native-sensor-report.js.map +1 -0
  140. package/dist/sensor/sensor-characteristics.d.ts +81 -13
  141. package/dist/sensor/sensor-characteristics.js +10 -6
  142. package/dist/sensor/sensor-characteristics.js.map +1 -1
  143. package/docs/API_REFERENCE.md +117 -4
  144. package/docs/QUICK_START.md +37 -8
  145. package/docs/USAGE.md +104 -22
  146. package/docs/api/capture-c2pa-embed.md +177 -0
  147. package/docs/api/capture-dng-import.md +86 -10
  148. package/docs/api/capture-dng-opcodes.md +93 -0
  149. package/docs/api/capture-dng-profile-maps.md +141 -0
  150. package/docs/api/capture-dng-stage-image.md +43 -0
  151. package/docs/api/capture-jpeg-xl-tiles.md +33 -0
  152. package/docs/api/capture-lossy-jpeg.md +41 -0
  153. package/docs/api/capture-native-raw-development.md +2 -1
  154. package/docs/api/core-execution-error.md +43 -0
  155. package/docs/api/core-version.md +1 -1
  156. package/docs/api/exports.json +255 -5
  157. package/docs/api/facade-display-view-gpu.md +5 -2
  158. package/docs/api/facade-display-view.md +11 -15
  159. package/docs/api/facade-fast-methods.md +38 -9
  160. package/docs/api/facade-quality-paths.md +24 -0
  161. package/docs/api/facade-scene-radiance.md +1 -1
  162. package/docs/api/facade-simulate-capture.md +24 -7
  163. package/docs/api/facade-simulate-display-view.md +10 -12
  164. package/docs/api/gpu-image-kernel-execution.md +0 -36
  165. package/docs/api/output-camera-channel-response.md +55 -0
  166. package/docs/api/output-sdr-rendering.md +6 -1
  167. package/docs/api/sensor-sensor-characteristics.md +54 -2
  168. package/llms.txt +1 -0
  169. package/package.json +6 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-view-rendering.js","sourceRoot":"","sources":["../../src/facade/display-view-rendering.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAkD,MAAM,4BAA4B,CAAC;AAC1I,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAA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,IAAI,UAAU,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;AACrQ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * #593 (2.22.0): the display view's rendering steps that couple a pixel's three components: the luminance tone curves\n * (`extended-reinhard-luminance`, `naka-rushton-luminance`), `highlightMode: \"reconstruct\"` and (#601) the hue-preserving\n * gamut handling `desaturate-to-luminance`. The view never draws a pixel's noise; it propagates the mean and covariance of the\n * pixel's camera channels (normal, docs/DISPLAY_VIEW.md) through development, so a coupled step needs the moments of a function\n * of three correlated normals. Two methods, both acting on each pixel's own developed values at use (no lookup tables):\n *\n * - **Tone curves by conditioning on luminance.** With the developed linear sRGB y ~ N(μ, Σ) and the luminance L = wᵀy (w the\n * sRGB Y row), y_k given L is normal with mean μ_k + β_k(L − μ_L), β = Σw/(wᵀΣw), and variance Σ_kk − β_k·(Σw)_k (standard\n * Gaussian conditioning). The rendered component clip(y_k·r(L), 0, 1), r = f(L)/L, then has the closed-form clipped-normal\n * moments for each L, and its expectation is a 1-D integral over L: full, a composite 16-point Gauss–Legendre rule over\n * μ_L ± 8.5σ_L in 4 panels (split at L = 0, where the curves leave a pixel unchanged), the structure of the per-channel Reinhard\n * moments; fast, an 8-point Gauss–Hermite rule in L where the range does not reach L = 0 (else the full rule). The expected\n * slopes (Stein's lemma, for the view's linear noise part) are E[∂out_k/∂y_j] = E[1_in·(δ_kj·r + y_k·r′(L)·w_j)], from the\n * same conditional moments. Derived for this engine from standard Gaussian conditioning; the curves are those of\n * src/output/sdr-rendering.ts (Reinhard et al. 2002; Naka & Rushton 1966).\n * - **Reconstruct and desaturation by a 3-D rule.** The blend of `reconstruct` (src/color/sensor-color-development.ts) depends on\n * the largest camera channel and the clipped channels' largest value, and the desaturation on the largest rendered component:\n * piecewise-smooth functions of all three. Where a pixel's camera channels reach the blend (any channel within 8.5σ of 0.8 of\n * white or above) or, with the desaturation, a rendered component reaches 1, the whole chain (white balance, highlight,\n * matrix, tone curve, desaturation, clip) is integrated over the pixel's normal camera channels with a tensor Gauss–Hermite\n * rule in Cholesky coordinates (nodes and weights from the Jacobi matrix's eigenvalues, Golub & Welsch 1969; NIST DLMF\n * §3.5(v)): full 16 points per axis (4,096 nodes), fast 6 per axis (216). Elsewhere `reconstruct` is the unclipped white\n * balance (exactly linear) and the desaturation leaves the pixel unchanged.\n * The fast rules are the registered fast methods `output.toneCurve/view-luminance-moments` and\n * `output.highlightMode.reconstruct/view-moments` (src/facade/fast-methods.ts); their measured bounds are in docs/DISPLAY_VIEW.md.\n */\n\nimport { portablePow } from \"../core/portable-math.js\";\nimport { CLIP_REACH_SIGMA, GL, bigPhi, phi } from \"./display-view-normal.js\";\nimport { desaturateToLuminance, SDR_LUMINANCE_WEIGHTS, type SdrToneCurve, type SdrToneCurveParameters } from \"../output/sdr-rendering.js\";\nimport { RAW_HIGHLIGHT_RECONSTRUCTION_START } from \"../color/sensor-color-development.js\";\nimport type { DisplayViewSetup } from \"./display-view.js\";\nimport { NEIGHBOR_HIGHLIGHT_MARGIN, NEIGHBOR_HIGHLIGHT_RING, NEIGHBOR_HIGHLIGHT_SOR, NEIGHBOR_HIGHLIGHT_THRESHOLD, rebuildClippedPixel } from \"../color/neighbor-highlight-reconstruction.js\";\n\n/**\n * Internal (exported for tests). The n-point Gauss–Hermite rule of the standard normal: Σ w_i f(x_i) ≈ E[f(Z)], Z ~ N(0, 1).\n * The nodes are the eigenvalues of the Jacobi matrix of the orthonormal Hermite polynomials (zero diagonal, off-diagonal √k),\n * found by Sturm-sequence bisection, and w_i = 1/Σ_k p_k(x_i)² (Golub & Welsch 1969). Only correctly rounded operations, so the\n * rule has the same bits in every JavaScript engine.\n */\nexport function gaussHermite(n: number): { x: Float64Array; w: Float64Array } {\n const x = new Float64Array(n), w = new Float64Array(n), limit = 2 * Math.sqrt(n) + 1;\n /** The number of eigenvalues below λ (Sturm count of the LDLᵀ pivots). */\n const below = (lambda: number): number => {\n let count = 0, q = -lambda;\n for (let k = 1; ; k++) {\n if (q < 0) count++;\n if (k === n) return count;\n q = -lambda - k / (q === 0 ? 1e-300 : q);\n }\n };\n for (let i = 0; i < n; i++) {\n let lo = -limit, hi = limit;\n for (let it = 0; it < 200 && hi - lo > 0; it++) { const mid = (lo + hi) / 2; if (mid === lo || mid === hi) break; if (below(mid) > i) hi = mid; else lo = mid; }\n const z = (lo + hi) / 2;\n let p0 = 1, p1 = z, sum = 1 + (n > 1 ? z * z : 0);\n for (let k = 1; k < n - 1; k++) { const p2 = (z * p1 - Math.sqrt(k) * p0) / Math.sqrt(k + 1); p0 = p1; p1 = p2; sum += p2 * p2; }\n x[i] = z; w[i] = 1 / sum;\n }\n // Symmetric rule: the middle node of an odd rule is 0 exactly, and mirrored nodes share their weight.\n for (let i = 0; i < n >> 1; i++) { const a = (x[n - 1 - i]! - x[i]!) / 2, b = (w[i]! + w[n - 1 - i]!) / 2; x[i] = -a; x[n - 1 - i] = a; w[i] = b; w[n - 1 - i] = b; }\n if (n & 1) x[n >> 1] = 0;\n let total = 0;\n for (let i = 0; i < n; i++) total += w[i]!;\n for (let i = 0; i < n; i++) w[i] = w[i]! / total;\n return { x, w };\n}\n\n/** Points per axis of the 3-D rule (full and fast) and of the fast 1-D luminance rule. */\nexport const DISPLAY_VIEW_CHAIN_POINTS = /* @__PURE__ */ Object.freeze({ full: 16, fast: 6 });\nexport const DISPLAY_VIEW_LUMINANCE_FAST_POINTS = 8;\n\n/** What the view renders: the request's tone curve, highlight mode and gamut handling (#601), and whether the fast rules run. */\nexport interface DisplayViewRenderingChoice {\n toneCurve: SdrToneCurve;\n toneCurveParameters?: SdrToneCurveParameters;\n /** #602: \"reconstruct-neighbors\" rebuilds clipped channels from the ratios around each clipped region (src/color/neighbor-highlight-reconstruction.ts). */\n highlightMode: \"clip\" | \"reconstruct\" | \"reconstruct-neighbors\";\n gamutHandling: \"clip-components\" | \"desaturate-to-luminance\";\n fast: boolean;\n}\n\n/** The coupled steps of one view (see the module notes), or null for a view without them (its arithmetic is unchanged). */\nexport interface DisplayViewCoupledRendering {\n readonly luminanceTone: boolean;\n /** True with either reconstruct mode (the highlight step couples the channels). */\n readonly reconstruct: boolean;\n /** #602: the neighbor reconstruction (its pixels take their region's ratios, `bindView` and `at`). */\n readonly neighbors: boolean;\n /**\n * #602: binds a render's expected (noise-free) camera channels, from which the clipped regions and their ratios are found on\n * demand, and returns the counters of the regions it measured.\n */\n bindView?(setup: DisplayViewSetup): void;\n /** #602: the real pixel (native site coordinates) whose moments `chain` computes next. */\n at?(x: number, y: number): void;\n /** #602: regions measured, and regions whose search stopped at the size cap (their ratios from the part found). */\n readonly neighborRegions: { measured: number; capped: number };\n readonly desaturate: boolean;\n readonly choice: DisplayViewRenderingChoice;\n /** Points per axis of the 3-D rule in use; the luminance rule's Gauss–Hermite nodes and weights (8 points), for the GPU kernels. */\n readonly chainPoints: number;\n readonly chainRule: { x: Float64Array; w: Float64Array };\n readonly luminanceRule: { x: Float64Array; w: Float64Array };\n /** The luminance curve's ratio limit r(0+) (1, 0, 1/(σ·g(Lw)) or ∞). */\n readonly ratioAtZero: number;\n /** Renders one deterministic camera pixel (WB, highlight, matrix, tone, gamut, clip) into out (the AHD correction's pixels). */\n pixel(c0: number, c1: number, c2: number, out: Float64Array): void;\n /**\n * The moments of the rendered pixel for camera channels c ~ N(cm, C) (C row-major 3 × 3), integrated over the whole chain:\n * mean (hm), variance (hv) and the expected slopes ∂out_k/∂c_j (A, row-major 3 × 3). Returns the number of nodes evaluated.\n */\n chain(cm: Float64Array, C: Float64Array, hm: Float64Array, hv: Float64Array, A: Float64Array): number;\n /**\n * Whether the reconstruct blend is within reach of channels c ~ N(cm, C): some channel's mean + 8.5σ above the blend's start.\n * Out of reach the highlight step is the unclipped white balance.\n */\n reconstructInReach(cm: Float64Array, C: Float64Array): boolean;\n /**\n * The luminance tone curve on developed values y ~ N(μ, Σ) (Σ row-major 3 × 3): mean (hm), variance (hv) and the expected\n * slopes J = E[∂out/∂y] (row-major). Returns false when a component reaches 1 within reach and the desaturation is on (the\n * caller then integrates the chain), else true.\n */\n tone(mu: Float64Array, S: Float64Array, hm: Float64Array, hv: Float64Array, J: Float64Array): boolean;\n}\n\n/** #602: a render's noise-free camera channels at a real pixel (native coordinates), and the output raster's native bounds. */\nexport interface NeighborView {\n channels(x: number, y: number, out: Float64Array): void;\n x0: number; y0: number; width: number; height: number;\n}\n/** #602: the most pixels a clipped region's search visits (fast and full); a larger region takes its ratios from the part found. */\nexport const DISPLAY_VIEW_NEIGHBOR_REGION_LIMIT = /* @__PURE__ */ Object.freeze({ fast: 1 << 16, full: 1 << 18 });\n\n/** The tone ratio r(L) = f(L)/L and its derivative of a luminance curve, for L > 0. */\n/** The limit r(0+) of a luminance curve's ratio (where the curves meet the unchanged pixels at L = 0): 1, 0, 1/(σ·g(Lw)) or ∞. */\nfunction ratioAtZero(curve: SdrToneCurve, p: SdrToneCurveParameters | undefined): number {\n if (curve === \"extended-reinhard-luminance\" || !p || !(\"exponent\" in p)) return 1;\n const q = p as Extract<SdrToneCurveParameters, { exponent: number }>;\n return q.exponent > 1 ? 0 : q.exponent < 1 ? Infinity : (1 + q.semiSaturation / q.whiteLuminance) / q.semiSaturation;\n}\nfunction luminanceRatio(curve: SdrToneCurve, p: SdrToneCurveParameters | undefined): (l: number, out: Float64Array) => void {\n if (curve === \"extended-reinhard-luminance\" && p && !(\"exponent\" in p)) {\n const inverseWhite2 = 1 / (p.whiteLuminance * p.whiteLuminance);\n // f(L) = L(1 + L/Lw²)/(1 + L): r = (1 + L/Lw²)/(1 + L), r′ = (1/Lw² − 1)/(1 + L)².\n return (l, out) => { const d = 1 + l; out[0] = (1 + l * inverseWhite2) / d; out[1] = (inverseWhite2 - 1) / (d * d); };\n }\n const q = p as Extract<SdrToneCurveParameters, { exponent: number }>, n = q.exponent, sigma = q.semiSaturation;\n // g(L) = 1/(1 + u), u = (σ/L)ⁿ; f = g/g(Lw); r = g/(g(Lw)·L), r′ = g·(n·u·g − 1)/(g(Lw)·L²).\n const white = 1 / (1 + portablePow(sigma / q.whiteLuminance, n));\n return (l, out) => { const u = portablePow(sigma / l, n), g = 1 / (1 + u); out[0] = g / (white * l); out[1] = g * (n * u * g - 1) / (white * l * l); };\n}\n\n/**\n * Internal: the coupled rendering of a view, or null when its tone curve is per channel, its highlight mode `clip` and its gamut\n * handling the component clip (the view's own per-component arithmetic then runs, byte for byte as before).\n */\nexport function createDisplayViewCoupledRendering(choice: DisplayViewRenderingChoice, gains: readonly number[], clipLevel: number,\n matrix: readonly (readonly number[])[]): DisplayViewCoupledRendering | null {\n const luminanceTone = choice.toneCurve === \"extended-reinhard-luminance\" || choice.toneCurve === \"naka-rushton-luminance\";\n const neighbors = choice.highlightMode === \"reconstruct-neighbors\", reconstruct = choice.highlightMode === \"reconstruct\" || neighbors, desaturate = choice.gamutHandling === \"desaturate-to-luminance\";\n if (!luminanceTone && !reconstruct && !desaturate) return null;\n const reinhard = choice.toneCurve === \"positive-reinhard-per-channel\", ratio = luminanceTone ? luminanceRatio(choice.toneCurve, choice.toneCurveParameters) : null;\n const ratioZero = ratioAtZero(choice.toneCurve, choice.toneCurveParameters);\n const w0 = SDR_LUMINANCE_WEIGHTS[0]!, w1 = SDR_LUMINANCE_WEIGHTS[1]!, w2 = SDR_LUMINANCE_WEIGHTS[2]!, w = [w0, w1, w2];\n const g = Float64Array.from(gains), L = clipLevel, M = Float64Array.from(matrix.flat()), start = RAW_HIGHLIGHT_RECONSTRUCTION_START;\n const chainRule = gaussHermite(choice.fast ? DISPLAY_VIEW_CHAIN_POINTS.fast : DISPLAY_VIEW_CHAIN_POINTS.full), hermite8 = gaussHermite(DISPLAY_VIEW_LUMINANCE_FAST_POINTS);\n const rr = new Float64Array(2), b = new Float64Array(3), Jb = new Float64Array(9), y = new Float64Array(3), z = new Float64Array(3), Jt = new Float64Array(9), Jz = new Float64Array(9);\n const T = new Float64Array(9), c = new Float64Array(3), out = new Float64Array(3), Jo = new Float64Array(9), chol = new Float64Array(9);\n /** The highlight step b(c) and its slopes Jb = ∂b/∂c (a.e.), as `prepareSensorColorDevelopment` develops. */\n function highlight(c0: number, c1: number, c2: number): void {\n const u0 = c0 * g[0]!, u1 = c1 * g[1]!, u2 = c2 * g[2]!;\n Jb.fill(0);\n if (neighbors) {\n // #602: the pixel's region ratios (its own chromaticity when no region is bound: the rebuild then keeps u).\n if (rho) rebuildClippedPixel(c0, c1, c2, g, rho, b, Jb);\n else { b[0] = u0; b[1] = u1; b[2] = u2; Jb[0] = g[0]!; Jb[4] = g[1]!; Jb[8] = g[2]!; }\n return;\n }\n if (!reconstruct) {\n b[0] = u0 > L ? L : u0; b[1] = u1 > L ? L : u1; b[2] = u2 > L ? L : u2;\n Jb[0] = u0 > L ? 0 : g[0]!; Jb[4] = u1 > L ? 0 : g[1]!; Jb[8] = u2 > L ? 0 : g[2]!;\n return;\n }\n const s = c0 > c1 ? (c0 > c2 ? c0 : c2) : (c1 > c2 ? c1 : c2);\n if (!(s > start)) { b[0] = u0; b[1] = u1; b[2] = u2; Jb[0] = g[0]!; Jb[4] = g[1]!; Jb[8] = g[2]!; return; }\n const sIndex = c0 > c1 ? (c0 > c2 ? 0 : 2) : (c1 > c2 ? 1 : 2);\n const k0 = u0 > L ? L : u0, k1 = u1 > L ? L : u1, k2 = u2 > L ? L : u2, n = k0 > k1 ? (k0 > k2 ? k0 : k2) : (k1 > k2 ? k1 : k2);\n const nIndex = k0 > k1 ? (k0 > k2 ? 0 : 2) : (k1 > k2 ? 1 : 2), nSlope = (nIndex === 0 ? u0 : nIndex === 1 ? u1 : u2) > L ? 0 : g[nIndex]!;\n const t = s >= 1 ? 1 : (s - start) / (1 - start), tSlope = s >= 1 ? 0 : 1 / (1 - start);\n b[0] = (1 - t) * u0 + t * n; b[1] = (1 - t) * u1 + t * n; b[2] = (1 - t) * u2 + t * n;\n for (let k = 0; k < 3; k++) {\n const uk = k === 0 ? u0 : k === 1 ? u1 : u2;\n Jb[k * 4] = (1 - t) * g[k]!;\n Jb[k * 3 + nIndex] = Jb[k * 3 + nIndex]! + t * nSlope;\n Jb[k * 3 + sIndex] = Jb[k * 3 + sIndex]! + (n - uk) * tSlope;\n }\n }\n /** Tone, gamut and clip of developed y into out, with the slopes Jo = ∂out/∂y (a.e.). */\n function render(): void {\n Jt.fill(0);\n if (ratio) {\n const l = w0 * y[0]! + w1 * y[1]! + w2 * y[2]!;\n if (l > 0) {\n ratio(l, rr);\n const r = rr[0]!, rp = rr[1]!;\n for (let k = 0; k < 3; k++) { z[k] = y[k]! * r; for (let j = 0; j < 3; j++) Jt[k * 3 + j] = (k === j ? r : 0) + y[k]! * rp * w[j]!; }\n } else for (let k = 0; k < 3; k++) { z[k] = y[k]!; Jt[k * 4] = 1; }\n } else for (let k = 0; k < 3; k++) {\n const v = y[k]!;\n if (reinhard && v > 0) { z[k] = v / (1 + v); Jt[k * 4] = 1 / ((1 + v) * (1 + v)); } else { z[k] = v; Jt[k * 4] = 1; }\n }\n // #601: toward the luminance until the largest component is 1 (src/output/sdr-rendering.ts, desaturateToLuminance).\n const top = z[0]! > z[1]! ? (z[0]! > z[2]! ? 0 : 2) : (z[1]! > z[2]! ? 1 : 2), zt = z[top]!;\n if (desaturate && zt > 1) {\n const lp = w0 * z[0]! + w1 * z[1]! + w2 * z[2]!;\n if (lp >= 1) { out.fill(1); Jo.fill(0); return; }\n const d = zt - lp, a = (1 - lp) / d;\n // ∂a/∂z_j = (−w_j·d − (1 − lp)·(δ_tj − w_j))/d².\n for (let j = 0; j < 9; j++) Jz[j] = 0;\n for (let k = 0; k < 3; k++) for (let j = 0; j < 3; j++) {\n const da = (-w[j]! * d - (1 - lp) * ((j === top ? 1 : 0) - w[j]!)) / (d * d);\n Jz[k * 3 + j] = w[j]! * (1 - a) + (k === j ? a : 0) + (z[k]! - lp) * da;\n }\n desaturateToLuminance(z);\n } else { Jz.fill(0); Jz[0] = 1; Jz[4] = 1; Jz[8] = 1; }\n // Jo = diag(inside)·Jz·Jt.\n for (let k = 0; k < 3; k++) {\n const v = z[k]!, inside = v > 0 && v < 1;\n out[k] = v < 0 ? 0 : v > 1 ? 1 : v;\n for (let j = 0; j < 3; j++) Jo[k * 3 + j] = inside ? Jz[k * 3]! * Jt[j]! + Jz[k * 3 + 1]! * Jt[3 + j]! + Jz[k * 3 + 2]! * Jt[6 + j]! : 0;\n }\n }\n function develop(c0: number, c1: number, c2: number): void {\n highlight(c0, c1, c2);\n for (let k = 0; k < 3; k++) y[k] = M[k * 3]! * b[0]! + M[k * 3 + 1]! * b[1]! + M[k * 3 + 2]! * b[2]!;\n render();\n }\n function pixel(c0: number, c1: number, c2: number, result: Float64Array): void {\n develop(c0, c1, c2);\n result[0] = out[0]!; result[1] = out[1]!; result[2] = out[2]!;\n }\n function chain(cm: Float64Array, C: Float64Array, hm: Float64Array, hv: Float64Array, A: Float64Array): number {\n // Cholesky factor of C (positive semidefinite; tiny negative pivots are treated as 0).\n chol.fill(0);\n const l00 = Math.sqrt(Math.max(0, C[0]!)), l10 = l00 > 0 ? C[3]! / l00 : 0, l20 = l00 > 0 ? C[6]! / l00 : 0;\n const l11 = Math.sqrt(Math.max(0, C[4]! - l10 * l10)), l21 = l11 > 0 ? (C[7]! - l20 * l10) / l11 : 0, l22 = Math.sqrt(Math.max(0, C[8]! - l20 * l20 - l21 * l21));\n const rule = l00 > 0 || l11 > 0 || l22 > 0 ? chainRule : { x: Float64Array.of(0), w: Float64Array.of(1) }, n = rule.x.length;\n let e0 = 0, e1 = 0, e2 = 0, q0 = 0, q1 = 0, q2 = 0;\n T.fill(0);\n for (let i = 0; i < n; i++) {\n const x0 = rule.x[i]!, wi = rule.w[i]!;\n for (let j = 0; j < (l11 > 0 || l21 !== 0 || l22 > 0 ? n : 1); j++) {\n const x1 = l11 > 0 || l21 !== 0 || l22 > 0 ? rule.x[j]! : 0, wj = l11 > 0 || l21 !== 0 || l22 > 0 ? wi * rule.w[j]! : wi;\n for (let k = 0; k < (l22 > 0 ? n : 1); k++) {\n const x2 = l22 > 0 ? rule.x[k]! : 0, weight = l22 > 0 ? wj * rule.w[k]! : wj;\n c[0] = cm[0]! + l00 * x0; c[1] = cm[1]! + l10 * x0 + l11 * x1; c[2] = cm[2]! + l20 * x0 + l21 * x1 + l22 * x2;\n develop(c[0], c[1], c[2]);\n e0 += weight * out[0]!; e1 += weight * out[1]!; e2 += weight * out[2]!;\n q0 += weight * out[0]! * out[0]!; q1 += weight * out[1]! * out[1]!; q2 += weight * out[2]! * out[2]!;\n // ∂out/∂c = Jo·M·Jb.\n for (let r = 0; r < 3; r++) for (let s = 0; s < 3; s++) {\n const ms = M[r * 3]! * Jb[s]! + M[r * 3 + 1]! * Jb[3 + s]! + M[r * 3 + 2]! * Jb[6 + s]!;\n for (let o = 0; o < 3; o++) T[o * 3 + s] = T[o * 3 + s]! + weight * Jo[o * 3 + r]! * ms;\n }\n }\n }\n }\n hm[0] = e0; hm[1] = e1; hm[2] = e2;\n hv[0] = Math.max(0, q0 - e0 * e0); hv[1] = Math.max(0, q1 - e1 * e1); hv[2] = Math.max(0, q2 - e2 * e2);\n A.set(T);\n return n ** ((l00 > 0 ? 1 : 0) + (l11 > 0 || l21 !== 0 || l22 > 0 ? 1 : 0) + (l22 > 0 ? 1 : 0));\n }\n function reconstructInReach(cm: Float64Array, C: Float64Array): boolean {\n const threshold = neighbors ? NEIGHBOR_HIGHLIGHT_THRESHOLD : start;\n for (let k = 0; k < 3; k++) if (!(cm[k]! + CLIP_REACH_SIGMA * Math.sqrt(Math.max(0, C[k * 4]!)) < threshold)) return true;\n return false;\n }\n // #602: the region ratios of the bound view, found on demand (noise-free channels; see the module notes of the capture's method).\n let rho: Float64Array | null = null, view: NeighborView | null = null;\n const ratioOf = new Map<number, Float64Array>(), channelMemo = new Map<number, Float64Array>(), neighborRegions = { measured: 0, capped: 0 };\n const H = NEIGHBOR_HIGHLIGHT_THRESHOLD, limit = choice.fast ? DISPLAY_VIEW_NEIGHBOR_REGION_LIMIT.fast : DISPLAY_VIEW_NEIGHBOR_REGION_LIMIT.full;\n function channelsAt(x: number, y: number): Float64Array {\n const key = y * 1048576 + x;\n let v = channelMemo.get(key);\n if (!v) { v = new Float64Array(3); view!.channels(x, y, v); channelMemo.set(key, v); }\n return v;\n }\n const inside = (x: number, y: number): boolean => x >= view!.x0 && y >= view!.y0 && x < view!.x0 + view!.width && y < view!.y0 + view!.height;\n const isClipped = (v: Float64Array): boolean => v[0]! >= H || v[1]! >= H || v[2]! >= H;\n // A pixel within the margin of a clipped one gives no ratios (the capture's widened regions).\n const unknownMemo = new Map<number, boolean>(), D = NEIGHBOR_HIGHLIGHT_MARGIN;\n function isUnknown(x: number, y: number): boolean {\n const key = y * 1048576 + x;\n let v = unknownMemo.get(key);\n if (v === undefined) {\n v = false;\n for (let qy = y - D; qy <= y + D && !v; qy++) for (let qx = x - D; qx <= x + D && !v; qx++) if (inside(qx, qy) && isClipped(channelsAt(qx, qy))) v = true;\n unknownMemo.set(key, v);\n }\n return v;\n }\n function ownRatio(v: Float64Array, out: Float64Array): void {\n const u0 = v[0]! * g[0]!, u1 = v[1]! * g[1]!, u2 = v[2]! * g[2]!, sum = u0 + u1 + u2;\n if (sum > 0) { out[0] = u0 / sum; out[1] = u1 / sum; out[2] = u2 / sum; } else out.fill(1 / 3);\n }\n function regionRatio(x: number, y: number): Float64Array {\n const key = y * 1048576 + x, known = ratioOf.get(key);\n if (known) return known;\n // The region (8-connected), breadth first, up to the cap.\n const members: number[] = [key], index = new Map<number, number>([[key, 0]]);\n let capped = false;\n for (let head = 0; head < members.length; head++) {\n const p = members[head]!, px = p % 1048576, py = (p - px) / 1048576;\n for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) {\n const qx = px + dx, qy = py + dy, q = qy * 1048576 + qx;\n if (!inside(qx, qy) || index.has(q) || !isUnknown(qx, qy)) continue;\n if (members.length >= limit) { capped = true; continue; }\n index.set(q, members.length); members.push(q);\n }\n }\n neighborRegions.measured++;\n if (capped) neighborRegions.capped++;\n // Fast: the ring's mean ratios (unclipped pixels within the ring width, each once).\n const R = NEIGHBOR_HIGHLIGHT_RING, seen = new Set<number>(), r = new Float64Array(3), mean = new Float64Array(3);\n let count = 0;\n for (const p of members) {\n const px = p % 1048576, py = (p - px) / 1048576;\n for (let qy = py - R; qy <= py + R; qy++) for (let qx = px - R; qx <= px + R; qx++) {\n const q = qy * 1048576 + qx;\n if (!inside(qx, qy) || seen.has(q) || index.has(q) || isUnknown(qx, qy)) continue;\n const v = channelsAt(qx, qy);\n seen.add(q); ownRatio(v, r); mean[0] = mean[0]! + r[0]!; mean[1] = mean[1]! + r[1]!; mean[2] = mean[2]! + r[2]!; count++;\n }\n }\n if (count > 0) { mean[0] = mean[0]! / count; mean[1] = mean[1]! / count; mean[2] = mean[2]! / count; } else mean.fill(1 / 3);\n const values = new Float64Array(3 * members.length);\n for (let i = 0; i < members.length; i++) values.set(mean, 3 * i);\n if (!choice.fast && count > 0) {\n // Full: successive over-relaxation of the discrete Laplace equation, Dirichlet values from the unclipped 4-neighbors.\n const { omega, tolerance, maximumIterations } = NEIGHBOR_HIGHLIGHT_SOR, boundary = new Map<number, Float64Array>();\n let change = Infinity;\n for (let sweep = 0; sweep < maximumIterations && change > tolerance; sweep++) {\n change = 0;\n for (let i = 0; i < members.length; i++) {\n const p = members[i]!, px = p % 1048576, py = (p - px) / 1048576;\n let a0 = 0, a1 = 0, a2 = 0, m = 0;\n for (let d = 0; d < 4; d++) {\n const qx = px + (d === 0 ? -1 : d === 1 ? 1 : 0), qy = py + (d === 2 ? -1 : d === 3 ? 1 : 0), q = qy * 1048576 + qx;\n if (!inside(qx, qy)) continue;\n const j = index.get(q);\n let src: Float64Array;\n if (j !== undefined) src = values.subarray(3 * j, 3 * j + 3);\n else {\n let bnd = boundary.get(q);\n if (!bnd) { bnd = new Float64Array(3); if (isUnknown(qx, qy)) bnd.set(mean); else ownRatio(channelsAt(qx, qy), bnd); boundary.set(q, bnd); }\n src = bnd;\n }\n a0 += src[0]!; a1 += src[1]!; a2 += src[2]!; m++;\n }\n if (m === 0) continue;\n for (let k = 0; k < 3; k++) {\n const old = values[3 * i + k]!, next = old + omega * ((k === 0 ? a0 : k === 1 ? a1 : a2) / m - old);\n values[3 * i + k] = next;\n if (Math.abs(next - old) > change) change = Math.abs(next - old);\n }\n }\n }\n }\n for (let i = 0; i < members.length; i++) ratioOf.set(members[i]!, values.subarray(3 * i, 3 * i + 3));\n return ratioOf.get(key)!;\n }\n const own = new Float64Array(3);\n function at(x: number, y: number): void {\n if (!view || !inside(x, y)) { rho = null; return; }\n if (isUnknown(x, y)) rho = regionRatio(x, y);\n else { ownRatio(channelsAt(x, y), own); rho = own; }\n }\n function bindView(setup: DisplayViewSetup): void {\n // The noise-free mosaic (expected normalized site values clipped at white, read reflect-101 at the raster's edges) through the\n // bilinear kernels: the expected camera channels of each real pixel (the capture's own demosaic for AHD captures is approximated).\n const W = setup.nativeWidth, Hh = setup.nativeHeight, k = setup.readout.map((r) => r.perElectron), dark = setup.readout.map((r) => r.darkElectrons);\n const site = (x: number, y: number): number => {\n const sx = x < 0 ? -x : x >= W ? 2 * W - 2 - x : x, sy = y < 0 ? -y : y >= Hh ? 2 * Hh - 2 - y : y;\n const ch = (sy & 1) === 0 ? ((sx & 1) === 0 ? 0 : 1) : ((sx & 1) === 0 ? 1 : 2), v = k[ch]! * (setup.signal.site(sx, sy) + dark[ch]!);\n return v < 1 ? v : 1;\n };\n view = { x0: setup.margin, y0: setup.margin, width: setup.frameWidth, height: setup.frameHeight, channels(x: number, y: number, out: Float64Array): void {\n const taps = setup.demosaic[(y & 1) * 2 + (x & 1)]!;\n for (let c = 0; c < 3; c++) { let sum = 0; for (const t of taps[c]!) sum += t.weight * site(x + t.dx, y + t.dy); out[c] = sum; }\n } };\n ratioOf.clear(); channelMemo.clear(); unknownMemo.clear(); neighborRegions.measured = 0; neighborRegions.capped = 0;\n }\n const m1 = new Float64Array(3), m2 = new Float64Array(3), sw = new Float64Array(3), beta = new Float64Array(3), cv = new Float64Array(3);\n /**\n * The clipped-normal terms of Z ~ N(m, v) on [0, 1]: P(0 < Z < 1), E[Z·1(0 < Z < 1)], E[Z²·1(0 < Z < 1)] and P(Z ≥ 1), into\n * rr-like slots (q). Closed form, as `unitClip` without its skewness term.\n */\n const q = new Float64Array(4);\n function clipped(m: number, v: number): void {\n if (!(v > 0)) { const inside = m > 0 && m < 1; q[0] = inside ? 1 : 0; q[1] = inside ? m : 0; q[2] = inside ? m * m : 0; q[3] = m >= 1 ? 1 : 0; return; }\n const s = Math.sqrt(v), a = -m / s, bb = (1 - m) / s;\n const Pa = a < -CLIP_REACH_SIGMA ? 0 : a > CLIP_REACH_SIGMA ? 1 : bigPhi(a), Pb = bb > CLIP_REACH_SIGMA ? 1 : bb < -CLIP_REACH_SIGMA ? 0 : bigPhi(bb);\n const da = a < -CLIP_REACH_SIGMA || a > CLIP_REACH_SIGMA ? 0 : phi(a), db = bb > CLIP_REACH_SIGMA || bb < -CLIP_REACH_SIGMA ? 0 : phi(bb);\n const inside = Pb - Pa;\n q[0] = inside; q[1] = m * inside + s * (da - db); q[2] = (m * m + v) * inside + 2 * m * s * (da - db) + v * (a * da - bb * db); q[3] = 1 - Pb;\n }\n function tone(mu: Float64Array, S: Float64Array, hm: Float64Array, hv: Float64Array, J: Float64Array): boolean {\n const muL = w0 * mu[0]! + w1 * mu[1]! + w2 * mu[2]!;\n for (let k = 0; k < 3; k++) sw[k] = S[k * 3]! * w0 + S[k * 3 + 1]! * w1 + S[k * 3 + 2]! * w2;\n const vL = w0 * sw[0]! + w1 * sw[1]! + w2 * sw[2]!, sL = vL > 0 ? Math.sqrt(vL) : 0;\n for (let k = 0; k < 3; k++) { beta[k] = sL > 0 ? sw[k]! / vL : 0; cv[k] = Math.max(0, S[k * 4]! - (sL > 0 ? beta[k]! * sw[k]! : 0)); }\n m1.fill(0); m2.fill(0); J.fill(0);\n let reachesTop = false;\n const node = (l: number, weight: number): void => {\n let r = 1, rp = 0;\n if (l > 0) { ratio!(l, rr); r = rr[0]!; rp = rr[1]!; }\n for (let k = 0; k < 3; k++) {\n const m = mu[k]! + beta[k]! * (l - muL);\n clipped(r * m, r * r * cv[k]!);\n m1[k] = m1[k]! + weight * (q[1]! + q[3]!);\n m2[k] = m2[k]! + weight * (q[2]! + q[3]!);\n if (q[3]! > 0) reachesTop = true;\n // E[∂out_k/∂y_j | L] = δ_kj·r·P_in + r′·w_j·E[y_k·1_in] (E[y_k·1_in] = E[Z·1_in]/r).\n for (let j = 0; j < 3; j++) J[k * 3 + j] = J[k * 3 + j]! + weight * ((k === j ? r * q[0]! : 0) + (rp === 0 ? 0 : rp * w[j]! * q[1]! / r));\n }\n };\n if (!(sL > 0)) node(muL, 1);\n else {\n const lo = muL - CLIP_REACH_SIGMA * sL, hi = muL + CLIP_REACH_SIGMA * sL;\n if (choice.fast && (muL > 2 * CLIP_REACH_SIGMA * sL || hi < 0)) for (let i = 0; i < hermite8.x.length; i++) node(muL + sL * hermite8.x[i]!, hermite8.w[i]!);\n else {\n // Composite 16-point Gauss–Legendre in 4 panels over [lo, hi], split at L = 0 where the curves leave the pixel unchanged; in\n // standardized units z = (L − μ_L)/σ_L, so a node's density is formed without the cancellation L − μ_L.\n const pieces = lo < 0 && hi > 0 ? [-CLIP_REACH_SIGMA, -muL / sL, CLIP_REACH_SIGMA] : [-CLIP_REACH_SIGMA, CLIP_REACH_SIGMA];\n for (let piece = 0; piece + 1 < pieces.length; piece++) {\n const a = pieces[piece]!, width = (pieces[piece + 1]! - a) / 4, half = width / 2;\n for (let p = 0; p < 4; p++) {\n const centre = a + (p + 0.5) * width;\n for (let k = 0; k < 16; k++) { const z = centre + half * GL.x[k]!; node(muL + sL * z, half * GL.w[k]! * phi(z)); }\n }\n }\n }\n }\n // Where the luminance's range holds L = 0 and the ratio jumps there (r(0+) ≠ 1), the rendered value jumps across the plane\n // wᵀy = 0, and the expected slopes gain p_L(0)·E[out(0+) − out(0−) | L = 0]·w_j (the jump's term of Stein's lemma).\n if (sL > 0 && ratioZero !== 1 && Math.abs(muL) < CLIP_REACH_SIGMA * sL) {\n const density = phi(muL / sL) / sL;\n for (let k = 0; k < 3; k++) {\n const m = mu[k]! - beta[k]! * muL, v = cv[k]!;\n clipped(m, v);\n const below = q[1]! + q[3]!;\n let above: number;\n if (ratioZero === Infinity) above = v > 0 ? bigPhi(m / Math.sqrt(v)) : m > 0 ? 1 : 0;\n else { clipped(ratioZero * m, ratioZero * ratioZero * v); above = q[1]! + q[3]!; }\n for (let j = 0; j < 3; j++) J[k * 3 + j] = J[k * 3 + j]! + density * (above - below) * w[j]!;\n }\n }\n for (let k = 0; k < 3; k++) { hm[k] = m1[k]!; hv[k] = Math.max(0, m2[k]! - m1[k]! * m1[k]!); }\n return !(desaturate && reachesTop);\n }\n return { luminanceTone, reconstruct, neighbors, ...(neighbors ? { bindView, at } : {}), neighborRegions, desaturate, choice, chainPoints: chainRule.x.length, chainRule, luminanceRule: hermite8, ratioAtZero: ratioZero, pixel, chain, reconstructInReach, tone };\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  /** Stream IDs of the display view's two seeded streams, distinct from the native charge (0) and read-noise (1) streams. */
2
2
  export declare const DISPLAY_VIEW_JITTER_STREAM_ID: 32;
3
3
  export declare const DISPLAY_VIEW_NOISE_STREAM_ID: 33;
4
- export declare const DISPLAY_VIEW_AHD_STREAM_ID: 34;
5
4
  export { createDisplayViewExpectedSignal, type DisplayViewExpectedSignal, type DisplayViewExpectedSignalInput, type DisplayViewQueryOffset, type DisplayViewScene } from "./expected-signal.js";
6
5
  import type { DisplayViewExpectedSignal, DisplayViewExpectedSignalInput } from "./expected-signal.js";
6
+ import type { DisplayViewCoupledRendering, DisplayViewRenderingChoice } from "./display-view-rendering.js";
7
+ import type { SdrToneCurve } from "../output/sdr-rendering.js";
7
8
  import type { ResolvedChartScene } from "./chart-scenes.js";
8
9
  import type { ResolvedChartMaterialLayers } from "./chart-material-layers.js";
9
10
  /**
@@ -91,23 +92,26 @@ export interface DisplayViewSetup {
91
92
  clipLevel: number;
92
93
  /** Camera channels (after WB and the highlight clip) → linear sRGB: rows are output components. */
93
94
  matrix: readonly (readonly number[])[];
94
- toneCurve: "identity" | "positive-reinhard-per-channel";
95
+ toneCurve: SdrToneCurve;
95
96
  /**
96
- * AHD only: the low-signal correction. `labMatrix` is the camera → XYZ matrix AHD measures homogeneity with (the profile's
97
- * matrix times the white-balance gains); samples whose pixel variance (linear light) exceeds `thresholdVariance` add the
98
- * correction of a flat neighbourhood with their channel means, estimated once per quantized state with `drawsPerState` draws.
97
+ * #593, #601 (2.22.0): the tone curve's parameters, the highlight mode, the gamut handling and whether the fast rules run, when
98
+ * the view renders a luminance tone curve, `highlightMode: "reconstruct"` or `desaturate-to-luminance`
99
+ * (src/facade/display-view-rendering.ts). Absent: the per-channel highlight clip and the component clip.
99
100
  */
100
- ahdCorrection?: {
101
- labMatrix: readonly (readonly number[])[];
102
- drawsPerState: number;
103
- thresholdVariance: number;
104
- };
101
+ rendering?: DisplayViewRenderingChoice;
102
+ /**
103
+ * The coupled steps of `rendering` (`createDisplayViewCoupledRendering`, src/facade/display-view-rendering.ts), created by the
104
+ * caller where it loaded that module on demand; present exactly when `rendering` is.
105
+ */
106
+ coupled?: DisplayViewCoupledRendering;
105
107
  /**
106
- * #447: a collect pass. The render adds to this set the grid key of every state its corrected samples interpolate between
107
- * (the corners `gridCorrection` would compute or read), computes and reads no state and leaves the cache untouched; its
108
- * corrections are zero, so its image is not a display view and is discarded by the caller.
108
+ * AHD only: `labMatrix` is the camera → XYZ matrix AHD measures homogeneity with (the profile's matrix times the
109
+ * white-balance gains), for AHD's choice on the noise-free mosaic (#457). 2.22.0: the view no longer adds a low-signal
110
+ * correction for the noise's effect on the choice (docs/DISPLAY_VIEW.md, "AHD at low signal").
109
111
  */
110
- ahdCollect?: Set<number>;
112
+ ahdChoice?: {
113
+ labMatrix: readonly (readonly number[])[];
114
+ };
111
115
  yieldControl(): Promise<void>;
112
116
  checkAbort(): void;
113
117
  /** #478: the inputs a GPU renderer builds its scene lookup from (see {@link DisplayViewGpuSetup}); not read by `renderDisplayView`. */
@@ -124,8 +128,6 @@ export interface DisplayViewRenderResult {
124
128
  /** Display pixels whose pilot found detail (full samples) and uniform ones (a quarter per axis). */
125
129
  detailPixelCount: number;
126
130
  uniformPixelCount: number;
127
- /** Display pixels whose expected value includes the AHD low-signal correction. */
128
- ahdCorrectedPixelCount: number;
129
131
  /**
130
132
  * 2.8 (#393): "exact-area-mean" when each display pixel averaged every real pixel of its footprint once, with its exact
131
133
  * overlap weight (views where a footprint holds at most K² real pixels); "stratified-monte-carlo" otherwise.
@@ -193,12 +195,6 @@ export interface AxisSums {
193
195
  export declare function axisSums(start: number, end: number, limit: number, margin: number): AxisSums;
194
196
  /** Internal (exported for tests). B for red, green and blue (Σ β² over the channel's sites, β normalized to unit sum) and Σ (w/A)². */
195
197
  export declare function footprintWeights(x: AxisSums, y: AxisSums, area: number, out: Float64Array): void;
196
- /** Grid of flat-neighbourhood states for the AHD correction: steps per octave of the normalized channel mean, octaves below white (exported for the GPU display view, #479). */
197
- export declare const AHD_KEY_STEPS = 8, AHD_KEY_OCTAVES = 12;
198
- /** Lowest grid level, 2^-AHD_KEY_OCTAVES of white (exact). */
199
- export declare const AHD_KEY_FLOOR: number;
200
- /** Grid levels per channel (indices 0 to AHD_KEY_OCTAVES·AHD_KEY_STEPS). */
201
- export declare const AHD_KEY_LEVELS: number;
202
198
  /**
203
199
  * Internal (exported for tests, #442): the window offset of each slot, slot (dy + reach)·(2·reach + 1) + dx + reach, as
204
200
  * two integer tables: dx[slot] = (slot mod side) − reach and dy[slot] = ⌊slot / side⌋ − reach. The render loop reads them
@@ -224,53 +220,42 @@ export interface DisplayViewCandidateTables {
224
220
  * have the same number of candidates, 1 or 2 (the record layout and the choice variance assume it), each with 3 channels.
225
221
  */
226
222
  export declare function flatDisplayViewCandidateTables(slots: readonly (readonly (readonly Int32Array[])[])[], weights: readonly (readonly (readonly Float64Array[])[])[], dense: readonly (readonly Float64Array[])[], list: readonly (readonly Int32Array[])[]): DisplayViewCandidateTables;
227
- /** Internal (exported for tests): the correction states kept across calls, and clearing them. */
228
- export declare function displayViewCorrectionStateCount(): number;
229
- export declare function clearDisplayViewCorrectionStates(): void;
230
223
  /**
231
- * 2.10 (#447): the AHD low-signal correction states of one setup, as a realm sends them to another. `key` is the setup's
232
- * correction key (`PreparedDisplayView.correctionKey()`), `gridKeys[i]` a state's grid key and `values[3·i …]` its three
233
- * values (28 bytes per state). Both arrays are transferable.
224
+ * 2.10 (#447), deprecated in 2.22.0: the AHD low-signal correction states of one setup, as a realm sent them to another. The
225
+ * display view keeps no correction states since 2.22.0, so {@link serializeDisplayViewCorrectionStates} returns none.
226
+ * Kept until 3.0.0.
227
+ * @deprecated Since 2.22.0: the display view has no AHD correction states. Removed in 3.0.0.
234
228
  */
235
229
  export interface DisplayViewCorrectionStateSet {
236
230
  key: string;
237
231
  gridKeys: Int32Array;
238
232
  values: Float64Array;
239
233
  }
240
- /** 2.10 (#447): the grid keys of the states a region needs (`PreparedDisplayView.collectCorrectionStates`), ascending. */
234
+ /**
235
+ * 2.10 (#447), deprecated in 2.22.0: the grid keys of the states a region needs (`PreparedDisplayView.collectCorrectionStates`).
236
+ * @deprecated Since 2.22.0: the display view has no AHD correction states. Removed in 3.0.0.
237
+ */
241
238
  export interface DisplayViewCorrectionStateKeys {
242
239
  key: string;
243
240
  gridKeys: Int32Array;
244
241
  }
245
- /** The inputs of one setup's correction states: the inputs of its correction key. */
246
- export type DisplayViewCorrectionSetup = Pick<DisplayViewSetup, "seed" | "readout" | "gains" | "clipLevel" | "matrix" | "toneCurve"> & {
247
- ahdCorrection: NonNullable<DisplayViewSetup["ahdCorrection"]>;
248
- };
249
- /** Internal (#447): the correction key of a setup, or null without the AHD correction (the key `renderDisplayView` looks its states up with). */
250
- export declare function displayViewCorrectionKey(setup: Pick<DisplayViewSetup, "seed" | "readout" | "gains" | "clipLevel" | "matrix" | "toneCurve" | "ahdCorrection">): string | null;
242
+ /** Internal (deprecated API): checks that `gridKeys` is an Int32Array of grid keys, as 2.10 to 2.21 required. */
243
+ export declare function checkDeprecatedGridKeys(gridKeys: unknown, caller: string): Int32Array;
251
244
  /**
252
- * 2.10 (#447): the AHD low-signal correction states this JavaScript realm holds (a Web Worker, a page), one entry per cached
253
- * setup, least recently used first, each state's grid key and three values copied out. Another realm adds them with
254
- * {@link bindDisplayViewCorrectionStates}; a render there then reads them instead of computing them, with the same bytes.
245
+ * 2.10 (#447), deprecated in 2.22.0: returned the AHD low-signal correction states this realm held. The display view keeps no
246
+ * correction states since 2.22.0 (the correction was removed; docs/DISPLAY_VIEW.md, "AHD at low signal"), so this returns an
247
+ * empty array. Kept until 3.0.0.
248
+ * @deprecated Since 2.22.0: returns `[]`; there is nothing to move between realms. Removed in 3.0.0.
255
249
  */
256
250
  export declare function serializeDisplayViewCorrectionStates(): DisplayViewCorrectionStateSet[];
257
251
  /**
258
- * 2.10 (#447): adds states another realm computed (an export, or `computeCorrectionStates` results) to this realm's cache and
259
- * returns the number of states added. For each entry, the grid keys its setup does not hold yet are appended; known ones are
260
- * left as they are (a state's values follow from its key, so they are equal). Every entry is checked before the cache is
261
- * touched: `key` a non-empty string, `gridKeys` an Int32Array of grid keys, `values` a Float64Array of 3 × `gridKeys.length`
262
- * finite numbers; otherwise it fails with an InvalidConfigurationError and the cache is unchanged. The cache's bounds apply as
263
- * in a render: an unknown key creates a setup and can evict the least recently used of the four kept, and a setup that
264
- * reaches 65 536 states is cleared before the next one is added. Import only keys a prepared view reported
265
- * (`correctionKey()`), so states a render here will read.
252
+ * 2.10 (#447), deprecated in 2.22.0: added states another realm computed to this realm's cache. The display view keeps no
253
+ * correction states since 2.22.0, so this checks `entries` as before (an array of `{ key, gridKeys, values }` with a non-empty
254
+ * string key, an Int32Array of grid keys and a Float64Array of 3 finite values per key; otherwise an
255
+ * InvalidConfigurationError) and returns 0: nothing is stored and no render reads them. Kept until 3.0.0.
256
+ * @deprecated Since 2.22.0: a checked no-op that returns 0. Removed in 3.0.0.
266
257
  */
267
258
  export declare function bindDisplayViewCorrectionStates(entries: readonly DisplayViewCorrectionStateSet[]): number;
268
- /**
269
- * Internal (#447, `PreparedDisplayView.computeCorrectionStates`): computes the states of the given grid keys for a setup (each
270
- * as a render computes it, read from the cache where it is held) and stores them in this realm's cache; returns each key's
271
- * three values in the order given. Yields to the host and checks for abort between states, as a render does.
272
- */
273
- export declare function computeDisplayViewCorrectionStates(setup: DisplayViewCorrectionSetup & Pick<DisplayViewSetup, "yieldControl" | "checkAbort">, gridKeys: Int32Array): Promise<DisplayViewCorrectionStateSet>;
274
259
  /**
275
260
  * Most real pixels a footprint may hold for the exact area mean (#393). Measured on 8-row strips of a 24 MP view (Siemens star
276
261
  * and dead leaves, one thread): the exact path matched the stratified estimator's time within run-to-run spread up to 25 real
@@ -278,19 +263,6 @@ export declare function computeDisplayViewCorrectionStates(setup: DisplayViewCor
278
263
  * evaluated while the stratified estimator takes a quarter of its samples per axis where the pilot finds no detail.
279
264
  */
280
265
  export declare const EXACT_AREA_MEAN_MAX_PIXELS = 25;
281
- /**
282
- * createAhdDemosaicTask's steps at the centre pixel of an 11 × 11 patch (patch (dy + 5)·11 + dx + 5, normalized site values):
283
- * `choose(phase)` fills the two candidates within 2 sites (`horizontal`, `vertical`: (dy + 2)·5 + dx + 2, three channels) and
284
- * returns the centre's direction, 0 horizontal, 1 vertical, 2 equal homogeneity (both averaged). Greens are read by flat
285
- * index (dy + 3)·7 + dx + 3; every value is formed with the same operations in the same order as the steps themselves,
286
- * except that CIELAB's cube root is `portableCbrt` (within 1 ulp of Math.cbrt) and squares are products, so the result has
287
- * the same bits in every JavaScript engine. (The task keeps its intermediate planes in float32; these are binary64.)
288
- */
289
- export declare function createAhdCentreSteps(labMatrix: readonly (readonly number[])[], patch: Float64Array): {
290
- horizontal: Float64Array;
291
- vertical: Float64Array;
292
- choose(phase: number): number;
293
- };
294
266
  /**
295
267
  * #457: AHD's direction at real pixels of the noise-free mosaic, as `createAhdDemosaicTask` computes it on the whole raster
296
268
  * (every neighbour read at its reflect-101 position, so a position's greens, candidates, CIELAB and homogeneity are those of