@photivra/engine 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1074) hide show
  1. package/CHANGELOG.md +401 -6
  2. package/CITATION.cff +1 -1
  3. package/NODE_SUPPORT.md +64 -12
  4. package/README.md +301 -182
  5. package/SECURITY.md +37 -28
  6. package/THIRD_PARTY.md +148 -4
  7. package/dist/camera/equivalent-focal-length.d.ts +13 -14
  8. package/dist/camera/equivalent-focal-length.js +15 -13
  9. package/dist/camera/equivalent-focal-length.js.map +1 -1
  10. package/dist/camera/field-of-view.d.ts +30 -19
  11. package/dist/camera/field-of-view.js +67 -18
  12. package/dist/camera/field-of-view.js.map +1 -1
  13. package/dist/camera/lens-projection.d.ts +170 -0
  14. package/dist/camera/lens-projection.js +444 -0
  15. package/dist/camera/lens-projection.js.map +1 -0
  16. package/dist/camera/projected-object-size.d.ts +10 -11
  17. package/dist/camera/projected-object-size.js +12 -10
  18. package/dist/camera/projected-object-size.js.map +1 -1
  19. package/dist/capture/capture-export-metadata.d.ts +9 -10
  20. package/dist/capture/capture-export-metadata.js +8 -5
  21. package/dist/capture/capture-export-metadata.js.map +1 -1
  22. package/dist/capture/dng-import.d.ts +91 -0
  23. package/dist/capture/dng-import.js +343 -0
  24. package/dist/capture/dng-import.js.map +1 -0
  25. package/dist/capture/environment-raw-producer.d.ts +37 -17
  26. package/dist/capture/environment-raw-producer.js +43 -19
  27. package/dist/capture/environment-raw-producer.js.map +1 -1
  28. package/dist/capture/export-jpeg.d.ts +35 -4
  29. package/dist/capture/export-jpeg.js +133 -47
  30. package/dist/capture/export-jpeg.js.map +1 -1
  31. package/dist/capture/export-tiff.d.ts +48 -24
  32. package/dist/capture/export-tiff.js +91 -31
  33. package/dist/capture/export-tiff.js.map +1 -1
  34. package/dist/capture/focus-control.d.ts +42 -65
  35. package/dist/capture/focus-control.js +56 -75
  36. package/dist/capture/focus-control.js.map +1 -1
  37. package/dist/capture/host-yield-cadence.d.ts +25 -0
  38. package/dist/capture/host-yield-cadence.js +25 -0
  39. package/dist/capture/host-yield-cadence.js.map +1 -0
  40. package/dist/capture/linear-encoding.d.ts +14 -12
  41. package/dist/capture/linear-encoding.js +14 -13
  42. package/dist/capture/linear-encoding.js.map +1 -1
  43. package/dist/capture/lossless-jpeg.d.ts +27 -0
  44. package/dist/capture/lossless-jpeg.js +237 -0
  45. package/dist/capture/lossless-jpeg.js.map +1 -0
  46. package/dist/capture/native-environment-lean.d.ts +227 -0
  47. package/dist/capture/native-environment-lean.js +974 -0
  48. package/dist/capture/native-environment-lean.js.map +1 -0
  49. package/dist/capture/native-environment-optical-stage.d.ts +97 -0
  50. package/dist/capture/native-environment-optical-stage.js +340 -0
  51. package/dist/capture/native-environment-optical-stage.js.map +1 -0
  52. package/dist/capture/native-environment-raw.d.ts +140 -6
  53. package/dist/capture/native-environment-raw.js +435 -34
  54. package/dist/capture/native-environment-raw.js.map +1 -1
  55. package/dist/capture/native-raw-development.d.ts +118 -5
  56. package/dist/capture/native-raw-development.js +224 -59
  57. package/dist/capture/native-raw-development.js.map +1 -1
  58. package/dist/capture/native-raw-dng.d.ts +60 -0
  59. package/dist/capture/native-raw-dng.js +167 -0
  60. package/dist/capture/native-raw-dng.js.map +1 -0
  61. package/dist/capture/native-raw.d.ts +67 -10
  62. package/dist/capture/native-raw.js +90 -24
  63. package/dist/capture/native-raw.js.map +1 -1
  64. package/dist/capture/packed-sensor-raw.d.ts +160 -0
  65. package/dist/capture/packed-sensor-raw.js +221 -0
  66. package/dist/capture/packed-sensor-raw.js.map +1 -0
  67. package/dist/capture/photographic-export.d.ts +58 -35
  68. package/dist/capture/photographic-export.js +177 -70
  69. package/dist/capture/photographic-export.js.map +1 -1
  70. package/dist/capture/raw-development-kernel.d.ts +52 -0
  71. package/dist/capture/raw-development-kernel.js +88 -0
  72. package/dist/capture/raw-development-kernel.js.map +1 -0
  73. package/dist/capture/raw-frame-limits.d.ts +7 -7
  74. package/dist/capture/raw-frame-limits.js +7 -6
  75. package/dist/capture/raw-frame-limits.js.map +1 -1
  76. package/dist/capture/raw-frame-reconstruction.d.ts +8 -9
  77. package/dist/capture/raw-frame-reconstruction.js +9 -8
  78. package/dist/capture/raw-frame-reconstruction.js.map +1 -1
  79. package/dist/capture/raw-white-level.d.ts +55 -0
  80. package/dist/capture/raw-white-level.js +165 -0
  81. package/dist/capture/raw-white-level.js.map +1 -0
  82. package/dist/capture/release-sequence.d.ts +5 -7
  83. package/dist/capture/release-sequence.js +15 -13
  84. package/dist/capture/release-sequence.js.map +1 -1
  85. package/dist/capture/sensor-raw-frame.d.ts +5 -6
  86. package/dist/capture/sensor-raw-frame.js +26 -9
  87. package/dist/capture/sensor-raw-frame.js.map +1 -1
  88. package/dist/capture/sensor-raw-producer.d.ts +21 -13
  89. package/dist/capture/sensor-raw-producer.js +86 -25
  90. package/dist/capture/sensor-raw-producer.js.map +1 -1
  91. package/dist/capture/simulated-capture.d.ts +15 -16
  92. package/dist/capture/simulated-capture.js +22 -12
  93. package/dist/capture/simulated-capture.js.map +1 -1
  94. package/dist/color/camera-color-matrix.d.ts +69 -0
  95. package/dist/color/camera-color-matrix.js +132 -0
  96. package/dist/color/camera-color-matrix.js.map +1 -0
  97. package/dist/color/capture-color.d.ts +17 -10
  98. package/dist/color/capture-color.js +50 -17
  99. package/dist/color/capture-color.js.map +1 -1
  100. package/dist/color/chromatic-adaptation.d.ts +63 -0
  101. package/dist/color/chromatic-adaptation.js +91 -0
  102. package/dist/color/chromatic-adaptation.js.map +1 -0
  103. package/dist/color/color-difference.d.ts +104 -0
  104. package/dist/color/color-difference.js +205 -0
  105. package/dist/color/color-difference.js.map +1 -0
  106. package/dist/color/color-matching-functions.d.ts +168 -0
  107. package/dist/color/color-matching-functions.js +309 -0
  108. package/dist/color/color-matching-functions.js.map +1 -0
  109. package/dist/color/colorimetry-math.d.ts +52 -0
  110. package/dist/color/colorimetry-math.js +144 -0
  111. package/dist/color/colorimetry-math.js.map +1 -0
  112. package/dist/color/gamut-mapping.d.ts +54 -0
  113. package/dist/color/gamut-mapping.js +107 -0
  114. package/dist/color/gamut-mapping.js.map +1 -0
  115. package/dist/color/illuminants.d.ts +182 -0
  116. package/dist/color/illuminants.js +434 -0
  117. package/dist/color/illuminants.js.map +1 -0
  118. package/dist/color/rgb-color-spaces.d.ts +79 -0
  119. package/dist/color/rgb-color-spaces.js +115 -0
  120. package/dist/color/rgb-color-spaces.js.map +1 -0
  121. package/dist/color/sensor-color-development.d.ts +33 -11
  122. package/dist/color/sensor-color-development.js +104 -30
  123. package/dist/color/sensor-color-development.js.map +1 -1
  124. package/dist/color/srgb-icc.d.ts +9 -2
  125. package/dist/color/srgb-icc.js +16 -5
  126. package/dist/color/srgb-icc.js.map +1 -1
  127. package/dist/color/srgb-transfer.d.ts +1 -2
  128. package/dist/color/srgb-transfer.js +1 -1
  129. package/dist/color/srgb-transfer.js.map +1 -1
  130. package/dist/color/white-balance.d.ts +68 -19
  131. package/dist/color/white-balance.js +168 -35
  132. package/dist/color/white-balance.js.map +1 -1
  133. package/dist/composition/image-formation-plan.d.ts +152 -128
  134. package/dist/composition/image-formation-plan.js +292 -138
  135. package/dist/composition/image-formation-plan.js.map +1 -1
  136. package/dist/composition/plan-consumer.d.ts +6 -7
  137. package/dist/composition/plan-consumer.js +14 -11
  138. package/dist/composition/plan-consumer.js.map +1 -1
  139. package/dist/core/calculation-result.d.ts +21 -14
  140. package/dist/core/calculation-result.js +209 -11
  141. package/dist/core/calculation-result.js.map +1 -1
  142. package/dist/core/canonical-json.d.ts +13 -8
  143. package/dist/core/canonical-json.js +34 -15
  144. package/dist/core/canonical-json.js.map +1 -1
  145. package/dist/core/configuration-error.d.ts +5 -4
  146. package/dist/core/configuration-error.js +5 -3
  147. package/dist/core/configuration-error.js.map +1 -1
  148. package/dist/core/evidence-provenance.d.ts +12 -12
  149. package/dist/core/evidence-provenance.js +10 -9
  150. package/dist/core/evidence-provenance.js.map +1 -1
  151. package/dist/core/image-formation.d.ts +11 -10
  152. package/dist/core/image-formation.js +11 -9
  153. package/dist/core/image-formation.js.map +1 -1
  154. package/dist/core/owned-data.d.ts +9 -17
  155. package/dist/core/owned-data.js +9 -16
  156. package/dist/core/owned-data.js.map +1 -1
  157. package/dist/core/portable-math.d.ts +15 -0
  158. package/dist/core/portable-math.js +56 -0
  159. package/dist/core/portable-math.js.map +1 -0
  160. package/dist/core/record-validation.d.ts +48 -9
  161. package/dist/core/record-validation.js +93 -19
  162. package/dist/core/record-validation.js.map +1 -1
  163. package/dist/core/scientific-assurance.d.ts +16 -14
  164. package/dist/core/scientific-assurance.js +22 -18
  165. package/dist/core/scientific-assurance.js.map +1 -1
  166. package/dist/core/spectral-composition.d.ts +13 -14
  167. package/dist/core/spectral-composition.js +30 -27
  168. package/dist/core/spectral-composition.js.map +1 -1
  169. package/dist/core/spectral.d.ts +5 -6
  170. package/dist/core/spectral.js +9 -7
  171. package/dist/core/spectral.js.map +1 -1
  172. package/dist/core/validation.d.ts +3 -6
  173. package/dist/core/validation.js +3 -5
  174. package/dist/core/validation.js.map +1 -1
  175. package/dist/core/version.d.ts +6 -6
  176. package/dist/core/version.js +6 -5
  177. package/dist/core/version.js.map +1 -1
  178. package/dist/equipment/exposure-capabilities.d.ts +10 -10
  179. package/dist/equipment/exposure-capabilities.js +40 -30
  180. package/dist/equipment/exposure-capabilities.js.map +1 -1
  181. package/dist/equipment/generic-tier-assets.d.ts +13 -6
  182. package/dist/equipment/generic-tier-assets.js +34 -15
  183. package/dist/equipment/generic-tier-assets.js.map +1 -1
  184. package/dist/equipment/generic-tier-presets.d.ts +5 -6
  185. package/dist/equipment/generic-tier-presets.js +15 -13
  186. package/dist/equipment/generic-tier-presets.js.map +1 -1
  187. package/dist/equipment/iso-capabilities.d.ts +21 -22
  188. package/dist/equipment/iso-capabilities.js +49 -44
  189. package/dist/equipment/iso-capabilities.js.map +1 -1
  190. package/dist/equipment/metering-capabilities.d.ts +5 -6
  191. package/dist/equipment/metering-capabilities.js +22 -19
  192. package/dist/equipment/metering-capabilities.js.map +1 -1
  193. package/dist/equipment/release-capabilities.d.ts +3 -4
  194. package/dist/equipment/release-capabilities.js +18 -14
  195. package/dist/equipment/release-capabilities.js.map +1 -1
  196. package/dist/exposure/exposure-duration-control.d.ts +19 -17
  197. package/dist/exposure/exposure-duration-control.js +27 -23
  198. package/dist/exposure/exposure-duration-control.js.map +1 -1
  199. package/dist/exposure/exposure-mode-resolver.d.ts +42 -39
  200. package/dist/exposure/exposure-mode-resolver.js +127 -82
  201. package/dist/exposure/exposure-mode-resolver.js.map +1 -1
  202. package/dist/exposure/exposure.d.ts +17 -16
  203. package/dist/exposure/exposure.js +22 -15
  204. package/dist/exposure/exposure.js.map +1 -1
  205. package/dist/exposure/flash-ttl.d.ts +135 -0
  206. package/dist/exposure/flash-ttl.js +193 -0
  207. package/dist/exposure/flash-ttl.js.map +1 -0
  208. package/dist/exposure/flash.d.ts +144 -36
  209. package/dist/exposure/flash.js +259 -59
  210. package/dist/exposure/flash.js.map +1 -1
  211. package/dist/exposure/metering-scene-radiance.d.ts +10 -10
  212. package/dist/exposure/metering-scene-radiance.js +42 -23
  213. package/dist/exposure/metering-scene-radiance.js.map +1 -1
  214. package/dist/exposure/metering-target.d.ts +8 -8
  215. package/dist/exposure/metering-target.js +30 -20
  216. package/dist/exposure/metering-target.js.map +1 -1
  217. package/dist/exposure/metering-temporal.d.ts +16 -15
  218. package/dist/exposure/metering-temporal.js +41 -19
  219. package/dist/exposure/metering-temporal.js.map +1 -1
  220. package/dist/exposure/metering.d.ts +64 -17
  221. package/dist/exposure/metering.js +159 -30
  222. package/dist/exposure/metering.js.map +1 -1
  223. package/dist/exposure/program-line.d.ts +5 -5
  224. package/dist/exposure/program-line.js +20 -13
  225. package/dist/exposure/program-line.js.map +1 -1
  226. package/dist/facade/camera-preset.d.ts +8 -0
  227. package/dist/facade/camera-preset.js +102 -0
  228. package/dist/facade/camera-preset.js.map +1 -0
  229. package/dist/facade/chart-radiance-batch.d.ts +57 -0
  230. package/dist/facade/chart-radiance-batch.js +121 -0
  231. package/dist/facade/chart-radiance-batch.js.map +1 -0
  232. package/dist/facade/chart-scenes.d.ts +177 -0
  233. package/dist/facade/chart-scenes.js +232 -0
  234. package/dist/facade/chart-scenes.js.map +1 -0
  235. package/dist/facade/host-yield.d.ts +7 -0
  236. package/dist/facade/host-yield.js +23 -0
  237. package/dist/facade/host-yield.js.map +1 -0
  238. package/dist/facade/scene-radiance.d.ts +117 -0
  239. package/dist/facade/scene-radiance.js +205 -0
  240. package/dist/facade/scene-radiance.js.map +1 -0
  241. package/dist/facade/simulate-capture.d.ts +284 -0
  242. package/dist/facade/simulate-capture.js +1026 -0
  243. package/dist/facade/simulate-capture.js.map +1 -0
  244. package/dist/gpu/chart-radiance-gpu.d.ts +17 -0
  245. package/dist/gpu/chart-radiance-gpu.js +176 -0
  246. package/dist/gpu/chart-radiance-gpu.js.map +1 -0
  247. package/dist/gpu/image-kernel-accelerator.d.ts +132 -0
  248. package/dist/gpu/image-kernel-accelerator.js +720 -0
  249. package/dist/gpu/image-kernel-accelerator.js.map +1 -0
  250. package/dist/gpu/image-kernel-execution.d.ts +92 -0
  251. package/dist/gpu/image-kernel-execution.js +84 -0
  252. package/dist/gpu/image-kernel-execution.js.map +1 -0
  253. package/dist/gpu/sensor-stage-gpu.d.ts +44 -0
  254. package/dist/gpu/sensor-stage-gpu.js +317 -0
  255. package/dist/gpu/sensor-stage-gpu.js.map +1 -0
  256. package/dist/gpu/temporal-sum-gpu.d.ts +23 -0
  257. package/dist/gpu/temporal-sum-gpu.js +150 -0
  258. package/dist/gpu/temporal-sum-gpu.js.map +1 -0
  259. package/dist/gpu/webgpu-runtime.d.ts +63 -0
  260. package/dist/gpu/webgpu-runtime.js +215 -0
  261. package/dist/gpu/webgpu-runtime.js.map +1 -0
  262. package/dist/gpu/wgsl-chart-kernel.d.ts +30 -0
  263. package/dist/gpu/wgsl-chart-kernel.js +165 -0
  264. package/dist/gpu/wgsl-chart-kernel.js.map +1 -0
  265. package/dist/gpu/wgsl-kernels.d.ts +53 -0
  266. package/dist/gpu/wgsl-kernels.js +365 -0
  267. package/dist/gpu/wgsl-kernels.js.map +1 -0
  268. package/dist/gpu/wgsl-sensor-kernel.d.ts +64 -0
  269. package/dist/gpu/wgsl-sensor-kernel.js +409 -0
  270. package/dist/gpu/wgsl-sensor-kernel.js.map +1 -0
  271. package/dist/index.d.ts +89 -25
  272. package/dist/index.js +59 -15
  273. package/dist/index.js.map +1 -1
  274. package/dist/motion/camera-rotation.d.ts +92 -40
  275. package/dist/motion/camera-rotation.js +84 -47
  276. package/dist/motion/camera-rotation.js.map +1 -1
  277. package/dist/motion/capture-rotation-inverse-mapping.d.ts +37 -34
  278. package/dist/motion/capture-rotation-inverse-mapping.js +32 -24
  279. package/dist/motion/capture-rotation-inverse-mapping.js.map +1 -1
  280. package/dist/motion/capture-rotation-temporal-quadrature.d.ts +39 -35
  281. package/dist/motion/capture-rotation-temporal-quadrature.js +37 -28
  282. package/dist/motion/capture-rotation-temporal-quadrature.js.map +1 -1
  283. package/dist/motion/capture-rotation-trajectory.d.ts +32 -28
  284. package/dist/motion/capture-rotation-trajectory.js +36 -26
  285. package/dist/motion/capture-rotation-trajectory.js.map +1 -1
  286. package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts +23 -21
  287. package/dist/motion/capture-translation-parallax-temporal-quadrature.js +33 -14
  288. package/dist/motion/capture-translation-parallax-temporal-quadrature.js.map +1 -1
  289. package/dist/motion/extended-object-projection.d.ts +19 -16
  290. package/dist/motion/extended-object-projection.js +38 -18
  291. package/dist/motion/extended-object-projection.js.map +1 -1
  292. package/dist/motion/projected-motion.d.ts +18 -17
  293. package/dist/motion/projected-motion.js +25 -17
  294. package/dist/motion/projected-motion.js.map +1 -1
  295. package/dist/motion/temporal-exposure-sum.d.ts +55 -0
  296. package/dist/motion/temporal-exposure-sum.js +141 -0
  297. package/dist/motion/temporal-exposure-sum.js.map +1 -0
  298. package/dist/motion/video-sequence.d.ts +111 -0
  299. package/dist/motion/video-sequence.js +179 -0
  300. package/dist/motion/video-sequence.js.map +1 -0
  301. package/dist/optics/aperture.d.ts +14 -15
  302. package/dist/optics/aperture.js +13 -11
  303. package/dist/optics/aperture.js.map +1 -1
  304. package/dist/optics/atmospheric-haze.d.ts +83 -0
  305. package/dist/optics/atmospheric-haze.js +113 -0
  306. package/dist/optics/atmospheric-haze.js.map +1 -0
  307. package/dist/optics/brown-conrady-distortion.d.ts +116 -0
  308. package/dist/optics/brown-conrady-distortion.js +291 -0
  309. package/dist/optics/brown-conrady-distortion.js.map +1 -0
  310. package/dist/optics/circle-of-confusion.d.ts +10 -10
  311. package/dist/optics/circle-of-confusion.js +15 -11
  312. package/dist/optics/circle-of-confusion.js.map +1 -1
  313. package/dist/optics/complex-pupil-psf.d.ts +64 -33
  314. package/dist/optics/complex-pupil-psf.js +190 -98
  315. package/dist/optics/complex-pupil-psf.js.map +1 -1
  316. package/dist/optics/depth-of-field.d.ts +25 -15
  317. package/dist/optics/depth-of-field.js +67 -27
  318. package/dist/optics/depth-of-field.js.map +1 -1
  319. package/dist/optics/diffraction.d.ts +14 -13
  320. package/dist/optics/diffraction.js +14 -10
  321. package/dist/optics/diffraction.js.map +1 -1
  322. package/dist/optics/focus-breathing.d.ts +88 -27
  323. package/dist/optics/focus-breathing.js +114 -23
  324. package/dist/optics/focus-breathing.js.map +1 -1
  325. package/dist/optics/focus-state.d.ts +18 -18
  326. package/dist/optics/focus-state.js +21 -15
  327. package/dist/optics/focus-state.js.map +1 -1
  328. package/dist/optics/front-of-lens-filter.d.ts +45 -14
  329. package/dist/optics/front-of-lens-filter.js +259 -88
  330. package/dist/optics/front-of-lens-filter.js.map +1 -1
  331. package/dist/optics/illumination-vignetting.d.ts +16 -17
  332. package/dist/optics/illumination-vignetting.js +40 -17
  333. package/dist/optics/illumination-vignetting.js.map +1 -1
  334. package/dist/optics/irradiance-convolution.d.ts +59 -0
  335. package/dist/optics/irradiance-convolution.js +138 -0
  336. package/dist/optics/irradiance-convolution.js.map +1 -0
  337. package/dist/optics/lateral-chromatic-aberration.d.ts +33 -30
  338. package/dist/optics/lateral-chromatic-aberration.js +33 -23
  339. package/dist/optics/lateral-chromatic-aberration.js.map +1 -1
  340. package/dist/optics/lens-psf-kernels.d.ts +89 -0
  341. package/dist/optics/lens-psf-kernels.js +175 -0
  342. package/dist/optics/lens-psf-kernels.js.map +1 -0
  343. package/dist/optics/lens-psf-profile.d.ts +78 -46
  344. package/dist/optics/lens-psf-profile.js +335 -124
  345. package/dist/optics/lens-psf-profile.js.map +1 -1
  346. package/dist/optics/longitudinal-chromatic-aberration.d.ts +102 -0
  347. package/dist/optics/longitudinal-chromatic-aberration.js +210 -0
  348. package/dist/optics/longitudinal-chromatic-aberration.js.map +1 -0
  349. package/dist/optics/polygon-diffraction.d.ts +80 -23
  350. package/dist/optics/polygon-diffraction.js +130 -25
  351. package/dist/optics/polygon-diffraction.js.map +1 -1
  352. package/dist/optics/profile-contract.d.ts +5 -6
  353. package/dist/optics/profile-contract.js +14 -11
  354. package/dist/optics/profile-contract.js.map +1 -1
  355. package/dist/optics/psf-foundation.d.ts +23 -23
  356. package/dist/optics/psf-foundation.js +24 -21
  357. package/dist/optics/psf-foundation.js.map +1 -1
  358. package/dist/optics/pupil-vignetting.d.ts +118 -0
  359. package/dist/optics/pupil-vignetting.js +264 -0
  360. package/dist/optics/pupil-vignetting.js.map +1 -0
  361. package/dist/optics/radial-distortion.d.ts +34 -33
  362. package/dist/optics/radial-distortion.js +37 -30
  363. package/dist/optics/radial-distortion.js.map +1 -1
  364. package/dist/optics/scene-to-sensor-irradiance.d.ts +47 -33
  365. package/dist/optics/scene-to-sensor-irradiance.js +73 -45
  366. package/dist/optics/scene-to-sensor-irradiance.js.map +1 -1
  367. package/dist/optics/scene-to-sensor-quadrature.d.ts +23 -18
  368. package/dist/optics/scene-to-sensor-quadrature.js +16 -11
  369. package/dist/optics/scene-to-sensor-quadrature.js.map +1 -1
  370. package/dist/optics/sensor-aperture-rays.d.ts +20 -4
  371. package/dist/optics/sensor-aperture-rays.js +32 -14
  372. package/dist/optics/sensor-aperture-rays.js.map +1 -1
  373. package/dist/optics/sensor-environment-query.d.ts +81 -16
  374. package/dist/optics/sensor-environment-query.js +145 -12
  375. package/dist/optics/sensor-environment-query.js.map +1 -1
  376. package/dist/optics/sensor-psf-quadrature.d.ts +12 -10
  377. package/dist/optics/sensor-psf-quadrature.js +18 -11
  378. package/dist/optics/sensor-psf-quadrature.js.map +1 -1
  379. package/dist/optics/sensor-psf-support.d.ts +8 -6
  380. package/dist/optics/sensor-psf-support.js +8 -5
  381. package/dist/optics/sensor-psf-support.js.map +1 -1
  382. package/dist/optics/stray-light.d.ts +22 -19
  383. package/dist/optics/stray-light.js +18 -12
  384. package/dist/optics/stray-light.js.map +1 -1
  385. package/dist/optics/thin-lens.d.ts +10 -9
  386. package/dist/optics/thin-lens.js +12 -8
  387. package/dist/optics/thin-lens.js.map +1 -1
  388. package/dist/optics/zernike-wavefront.d.ts +154 -0
  389. package/dist/optics/zernike-wavefront.js +352 -0
  390. package/dist/optics/zernike-wavefront.js.map +1 -0
  391. package/dist/output/capture-corrected-sdr.d.ts +16 -8
  392. package/dist/output/capture-corrected-sdr.js +16 -8
  393. package/dist/output/capture-corrected-sdr.js.map +1 -1
  394. package/dist/output/capture-geometry.d.ts +34 -36
  395. package/dist/output/capture-geometry.js +52 -32
  396. package/dist/output/capture-geometry.js.map +1 -1
  397. package/dist/output/capture-sdr.d.ts +7 -6
  398. package/dist/output/capture-sdr.js +11 -8
  399. package/dist/output/capture-sdr.js.map +1 -1
  400. package/dist/output/crop.d.ts +22 -6
  401. package/dist/output/crop.js +40 -6
  402. package/dist/output/crop.js.map +1 -1
  403. package/dist/output/geometric-transforms.d.ts +60 -23
  404. package/dist/output/geometric-transforms.js +111 -24
  405. package/dist/output/geometric-transforms.js.map +1 -1
  406. package/dist/output/lens-corrections.d.ts +27 -19
  407. package/dist/output/lens-corrections.js +29 -13
  408. package/dist/output/lens-corrections.js.map +1 -1
  409. package/dist/output/native-capture-sdr.d.ts +71 -16
  410. package/dist/output/native-capture-sdr.js +190 -33
  411. package/dist/output/native-capture-sdr.js.map +1 -1
  412. package/dist/output/png-encoder.d.ts +65 -0
  413. package/dist/output/png-encoder.js +461 -0
  414. package/dist/output/png-encoder.js.map +1 -0
  415. package/dist/output/print-contrast-reference.d.ts +10 -9
  416. package/dist/output/print-contrast-reference.js +10 -8
  417. package/dist/output/print-contrast-reference.js.map +1 -1
  418. package/dist/output/print-detail.d.ts +18 -17
  419. package/dist/output/print-detail.js +12 -10
  420. package/dist/output/print-detail.js.map +1 -1
  421. package/dist/output/print-jpeg.d.ts +26 -5
  422. package/dist/output/print-jpeg.js +117 -50
  423. package/dist/output/print-jpeg.js.map +1 -1
  424. package/dist/output/print-plan.d.ts +19 -19
  425. package/dist/output/print-plan.js +11 -10
  426. package/dist/output/print-plan.js.map +1 -1
  427. package/dist/output/print-region-statistics.d.ts +14 -15
  428. package/dist/output/print-region-statistics.js +11 -11
  429. package/dist/output/print-region-statistics.js.map +1 -1
  430. package/dist/output/sdr-rendering.d.ts +48 -10
  431. package/dist/output/sdr-rendering.js +114 -25
  432. package/dist/output/sdr-rendering.js.map +1 -1
  433. package/dist/output/subject-framing-crop.d.ts +6 -10
  434. package/dist/output/subject-framing-crop.js +23 -13
  435. package/dist/output/subject-framing-crop.js.map +1 -1
  436. package/dist/processing/demosaic.d.ts +90 -0
  437. package/dist/processing/demosaic.js +275 -0
  438. package/dist/processing/demosaic.js.map +1 -0
  439. package/dist/processing/denoise.d.ts +68 -0
  440. package/dist/processing/denoise.js +214 -0
  441. package/dist/processing/denoise.js.map +1 -0
  442. package/dist/processing/focus-stacking.d.ts +17 -0
  443. package/dist/processing/focus-stacking.js +80 -0
  444. package/dist/processing/focus-stacking.js.map +1 -0
  445. package/dist/processing/hdr.d.ts +54 -0
  446. package/dist/processing/hdr.js +172 -0
  447. package/dist/processing/hdr.js.map +1 -0
  448. package/dist/processing/image-ops.d.ts +66 -0
  449. package/dist/processing/image-ops.js +192 -0
  450. package/dist/processing/image-ops.js.map +1 -0
  451. package/dist/processing/panorama.d.ts +51 -0
  452. package/dist/processing/panorama.js +305 -0
  453. package/dist/processing/panorama.js.map +1 -0
  454. package/dist/processing/processing-task.d.ts +85 -0
  455. package/dist/processing/processing-task.js +164 -0
  456. package/dist/processing/processing-task.js.map +1 -0
  457. package/dist/processing/tone-mapping.d.ts +69 -0
  458. package/dist/processing/tone-mapping.js +310 -0
  459. package/dist/processing/tone-mapping.js.map +1 -0
  460. package/dist/schema/camera.d.ts +5 -4
  461. package/dist/schema/illumination-spectral.d.ts +13 -19
  462. package/dist/schema/illumination-spectral.js +23 -19
  463. package/dist/schema/illumination-spectral.js.map +1 -1
  464. package/dist/schema/illumination-temporal.d.ts +12 -15
  465. package/dist/schema/illumination-temporal.js +43 -28
  466. package/dist/schema/illumination-temporal.js.map +1 -1
  467. package/dist/schema/illumination.d.ts +5 -4
  468. package/dist/schema/illumination.js +55 -20
  469. package/dist/schema/illumination.js.map +1 -1
  470. package/dist/schema/scene-radiance-temporal.d.ts +9 -11
  471. package/dist/schema/scene-radiance-temporal.js +26 -23
  472. package/dist/schema/scene-radiance-temporal.js.map +1 -1
  473. package/dist/schema/scene-radiance.d.ts +17 -17
  474. package/dist/schema/scene-radiance.js +56 -34
  475. package/dist/schema/scene-radiance.js.map +1 -1
  476. package/dist/schema/scene.d.ts +14 -13
  477. package/dist/schema/validation.d.ts +0 -1
  478. package/dist/schema/validation.js +17 -15
  479. package/dist/schema/validation.js.map +1 -1
  480. package/dist/sensor/accumulated-charge.d.ts +45 -64
  481. package/dist/sensor/accumulated-charge.js +41 -47
  482. package/dist/sensor/accumulated-charge.js.map +1 -1
  483. package/dist/sensor/architecture.d.ts +22 -25
  484. package/dist/sensor/architecture.js +17 -16
  485. package/dist/sensor/architecture.js.map +1 -1
  486. package/dist/sensor/camera-saturation-capacity.d.ts +21 -28
  487. package/dist/sensor/camera-saturation-capacity.js +36 -34
  488. package/dist/sensor/camera-saturation-capacity.js.map +1 -1
  489. package/dist/sensor/capture-color-sampling-binding.d.ts +46 -51
  490. package/dist/sensor/capture-color-sampling-binding.js +39 -41
  491. package/dist/sensor/capture-color-sampling-binding.js.map +1 -1
  492. package/dist/sensor/capture-mode-timing.d.ts +8 -9
  493. package/dist/sensor/capture-mode-timing.js +24 -21
  494. package/dist/sensor/capture-mode-timing.js.map +1 -1
  495. package/dist/sensor/capture-mode.d.ts +28 -30
  496. package/dist/sensor/capture-mode.js +33 -31
  497. package/dist/sensor/capture-mode.js.map +1 -1
  498. package/dist/sensor/color-sampling.d.ts +30 -33
  499. package/dist/sensor/color-sampling.js +32 -37
  500. package/dist/sensor/color-sampling.js.map +1 -1
  501. package/dist/sensor/constant-rate-temporal-integration.d.ts +19 -23
  502. package/dist/sensor/constant-rate-temporal-integration.js +28 -26
  503. package/dist/sensor/constant-rate-temporal-integration.js.map +1 -1
  504. package/dist/sensor/dark-current.d.ts +53 -49
  505. package/dist/sensor/dark-current.js +87 -46
  506. package/dist/sensor/dark-current.js.map +1 -1
  507. package/dist/sensor/environment-photo-signal.d.ts +71 -30
  508. package/dist/sensor/environment-photo-signal.js +127 -46
  509. package/dist/sensor/environment-photo-signal.js.map +1 -1
  510. package/dist/sensor/eqe-electron-rate.d.ts +14 -13
  511. package/dist/sensor/eqe-electron-rate.js +34 -14
  512. package/dist/sensor/eqe-electron-rate.js.map +1 -1
  513. package/dist/sensor/eqe-local-exposure.d.ts +24 -24
  514. package/dist/sensor/eqe-local-exposure.js +15 -11
  515. package/dist/sensor/eqe-local-exposure.js.map +1 -1
  516. package/dist/sensor/eqe-temporal-exposure.d.ts +11 -11
  517. package/dist/sensor/eqe-temporal-exposure.js +15 -10
  518. package/dist/sensor/eqe-temporal-exposure.js.map +1 -1
  519. package/dist/sensor/exposure-window.d.ts +48 -34
  520. package/dist/sensor/exposure-window.js +77 -36
  521. package/dist/sensor/exposure-window.js.map +1 -1
  522. package/dist/sensor/fixed-pattern-noise.d.ts +108 -0
  523. package/dist/sensor/fixed-pattern-noise.js +166 -0
  524. package/dist/sensor/fixed-pattern-noise.js.map +1 -0
  525. package/dist/sensor/iso-gain.d.ts +44 -0
  526. package/dist/sensor/iso-gain.js +119 -0
  527. package/dist/sensor/iso-gain.js.map +1 -0
  528. package/dist/sensor/iso-signal-chain.d.ts +25 -48
  529. package/dist/sensor/iso-signal-chain.js +52 -66
  530. package/dist/sensor/iso-signal-chain.js.map +1 -1
  531. package/dist/sensor/local-exposure-binding.d.ts +21 -21
  532. package/dist/sensor/local-exposure-binding.js +22 -18
  533. package/dist/sensor/local-exposure-binding.js.map +1 -1
  534. package/dist/sensor/optical-stack.d.ts +36 -40
  535. package/dist/sensor/optical-stack.js +34 -37
  536. package/dist/sensor/optical-stack.js.map +1 -1
  537. package/dist/sensor/photon-energy.d.ts +22 -28
  538. package/dist/sensor/photon-energy.js +42 -34
  539. package/dist/sensor/photon-energy.js.map +1 -1
  540. package/dist/sensor/physical-charge-capacity.d.ts +20 -30
  541. package/dist/sensor/physical-charge-capacity.js +35 -36
  542. package/dist/sensor/physical-charge-capacity.js.map +1 -1
  543. package/dist/sensor/pixel-pitch.d.ts +2 -3
  544. package/dist/sensor/pixel-pitch.js +4 -2
  545. package/dist/sensor/pixel-pitch.js.map +1 -1
  546. package/dist/sensor/radiometry-readiness.d.ts +13 -15
  547. package/dist/sensor/radiometry-readiness.js +20 -17
  548. package/dist/sensor/radiometry-readiness.js.map +1 -1
  549. package/dist/sensor/raw-readout.d.ts +173 -83
  550. package/dist/sensor/raw-readout.js +425 -160
  551. package/dist/sensor/raw-readout.js.map +1 -1
  552. package/dist/sensor/raw-reconstruction.d.ts +112 -44
  553. package/dist/sensor/raw-reconstruction.js +200 -47
  554. package/dist/sensor/raw-reconstruction.js.map +1 -1
  555. package/dist/sensor/readout-exposure-linkage.d.ts +103 -34
  556. package/dist/sensor/readout-exposure-linkage.js +125 -27
  557. package/dist/sensor/readout-exposure-linkage.js.map +1 -1
  558. package/dist/sensor/readout-timing.d.ts +43 -44
  559. package/dist/sensor/readout-timing.js +38 -30
  560. package/dist/sensor/readout-timing.js.map +1 -1
  561. package/dist/sensor/response-application-compatibility.d.ts +21 -28
  562. package/dist/sensor/response-application-compatibility.js +35 -34
  563. package/dist/sensor/response-application-compatibility.js.map +1 -1
  564. package/dist/sensor/response-operating-range.d.ts +26 -35
  565. package/dist/sensor/response-operating-range.js +40 -39
  566. package/dist/sensor/response-operating-range.js.map +1 -1
  567. package/dist/sensor/responsivity-photocurrent.d.ts +21 -29
  568. package/dist/sensor/responsivity-photocurrent.js +57 -40
  569. package/dist/sensor/responsivity-photocurrent.js.map +1 -1
  570. package/dist/sensor/sampling-aperture.d.ts +21 -25
  571. package/dist/sensor/sampling-aperture.js +29 -28
  572. package/dist/sensor/sampling-aperture.js.map +1 -1
  573. package/dist/sensor/scene-eqe-temporal-exposure.d.ts +14 -12
  574. package/dist/sensor/scene-eqe-temporal-exposure.js +13 -8
  575. package/dist/sensor/scene-eqe-temporal-exposure.js.map +1 -1
  576. package/dist/sensor/sensor-geometry.d.ts +28 -32
  577. package/dist/sensor/sensor-geometry.js +35 -20
  578. package/dist/sensor/sensor-geometry.js.map +1 -1
  579. package/dist/sensor/signal-noise.d.ts +14 -16
  580. package/dist/sensor/signal-noise.js +15 -13
  581. package/dist/sensor/signal-noise.js.map +1 -1
  582. package/dist/sensor/spatial-sample-reduction.d.ts +45 -60
  583. package/dist/sensor/spatial-sample-reduction.js +39 -48
  584. package/dist/sensor/spatial-sample-reduction.js.map +1 -1
  585. package/dist/sensor/spatial-sampling-quadrature.d.ts +46 -54
  586. package/dist/sensor/spatial-sampling-quadrature.js +31 -36
  587. package/dist/sensor/spatial-sampling-quadrature.js.map +1 -1
  588. package/dist/sensor/spatio-spectral-reduction.d.ts +32 -42
  589. package/dist/sensor/spatio-spectral-reduction.js +24 -29
  590. package/dist/sensor/spatio-spectral-reduction.js.map +1 -1
  591. package/dist/sensor/spectral-coverage.d.ts +6 -9
  592. package/dist/sensor/spectral-coverage.js +9 -6
  593. package/dist/sensor/spectral-coverage.js.map +1 -1
  594. package/dist/sensor/spectral-quadrature.d.ts +46 -60
  595. package/dist/sensor/spectral-quadrature.js +38 -48
  596. package/dist/sensor/spectral-quadrature.js.map +1 -1
  597. package/dist/sensor/spectral-response.d.ts +53 -41
  598. package/dist/sensor/spectral-response.js +80 -47
  599. package/dist/sensor/spectral-response.js.map +1 -1
  600. package/dist/sensor/stochastic-seed.d.ts +50 -0
  601. package/dist/sensor/stochastic-seed.js +123 -0
  602. package/dist/sensor/stochastic-seed.js.map +1 -0
  603. package/dist/sensor/temporal-eqe-sum.d.ts +2 -4
  604. package/dist/sensor/temporal-eqe-sum.js +5 -6
  605. package/dist/sensor/temporal-eqe-sum.js.map +1 -1
  606. package/dist/sensor/temporal-photo-signal.d.ts +5 -6
  607. package/dist/sensor/temporal-photo-signal.js +11 -10
  608. package/dist/sensor/temporal-photo-signal.js.map +1 -1
  609. package/dist/sensor/temporal-sample-binding.d.ts +1 -2
  610. package/dist/sensor/temporal-sample-binding.js +3 -3
  611. package/dist/sensor/temporal-sample-binding.js.map +1 -1
  612. package/dist/simulation/poc-simulation.d.ts +16 -16
  613. package/dist/simulation/poc-simulation.js +20 -15
  614. package/dist/simulation/poc-simulation.js.map +1 -1
  615. package/dist/stabilization/camera-shake.d.ts +42 -18
  616. package/dist/stabilization/camera-shake.js +43 -20
  617. package/dist/stabilization/camera-shake.js.map +1 -1
  618. package/dist/stabilization/system.d.ts +44 -41
  619. package/dist/stabilization/system.js +196 -108
  620. package/dist/stabilization/system.js.map +1 -1
  621. package/docs/AGENT_GUIDE.md +183 -0
  622. package/docs/API_REFERENCE.md +761 -2
  623. package/docs/QUICK_START.md +495 -0
  624. package/docs/USAGE.md +1719 -714
  625. package/docs/api/camera-equivalent-focal-length.md +6 -7
  626. package/docs/api/camera-field-of-view.md +16 -8
  627. package/docs/api/camera-lens-projection.md +246 -0
  628. package/docs/api/camera-projected-object-size.md +6 -5
  629. package/docs/api/capture-capture-export-metadata.md +10 -10
  630. package/docs/api/capture-dng-import.md +134 -0
  631. package/docs/api/capture-environment-raw-producer.md +17 -11
  632. package/docs/api/capture-export-jpeg.md +16 -0
  633. package/docs/api/capture-focus-control.md +25 -47
  634. package/docs/api/capture-linear-encoding.md +21 -12
  635. package/docs/api/capture-lossless-jpeg.md +49 -0
  636. package/docs/api/capture-native-environment-optical-stage.md +75 -0
  637. package/docs/api/capture-native-environment-raw.md +161 -4
  638. package/docs/api/capture-native-raw-development.md +69 -4
  639. package/docs/api/capture-native-raw-dng.md +84 -0
  640. package/docs/api/capture-native-raw.md +23 -8
  641. package/docs/api/capture-packed-sensor-raw.md +156 -0
  642. package/docs/api/capture-photographic-export.md +69 -31
  643. package/docs/api/capture-raw-frame-reconstruction.md +8 -8
  644. package/docs/api/capture-raw-white-level.md +37 -0
  645. package/docs/api/capture-release-sequence.md +6 -7
  646. package/docs/api/capture-sensor-raw-frame.md +6 -6
  647. package/docs/api/capture-sensor-raw-producer.md +17 -11
  648. package/docs/api/capture-simulated-capture.md +15 -15
  649. package/docs/api/color-camera-color-matrix.md +103 -0
  650. package/docs/api/color-capture-color.md +22 -11
  651. package/docs/api/color-chromatic-adaptation.md +82 -0
  652. package/docs/api/color-color-difference.md +134 -0
  653. package/docs/api/color-color-matching-functions.md +259 -0
  654. package/docs/api/color-colorimetry-math.md +54 -0
  655. package/docs/api/color-gamut-mapping.md +72 -0
  656. package/docs/api/color-illuminants.md +280 -0
  657. package/docs/api/color-rgb-color-spaces.md +151 -0
  658. package/docs/api/color-sensor-color-development.md +27 -0
  659. package/docs/api/color-srgb-icc.md +2 -4
  660. package/docs/api/color-white-balance.md +95 -19
  661. package/docs/api/composition-image-formation-plan.md +124 -95
  662. package/docs/api/composition-plan-consumer.md +7 -7
  663. package/docs/api/core-calculation-result.md +18 -14
  664. package/docs/api/core-configuration-error.md +1 -1
  665. package/docs/api/core-image-formation.md +7 -7
  666. package/docs/api/core-scientific-assurance.md +12 -10
  667. package/docs/api/core-spectral-composition.md +14 -14
  668. package/docs/api/core-spectral.md +6 -6
  669. package/docs/api/core-validation.md +3 -3
  670. package/docs/api/core-version.md +7 -6
  671. package/docs/api/equipment-exposure-capabilities.md +11 -10
  672. package/docs/api/equipment-generic-tier-assets.md +7 -2
  673. package/docs/api/equipment-generic-tier-presets.md +6 -6
  674. package/docs/api/equipment-iso-capabilities.md +18 -18
  675. package/docs/api/equipment-metering-capabilities.md +6 -6
  676. package/docs/api/equipment-release-capabilities.md +4 -4
  677. package/docs/api/exports.json +2213 -8
  678. package/docs/api/exposure-exposure-duration-control.md +9 -9
  679. package/docs/api/exposure-exposure-mode-resolver.md +35 -31
  680. package/docs/api/exposure-exposure.md +10 -10
  681. package/docs/api/exposure-flash-ttl.md +182 -0
  682. package/docs/api/exposure-flash.md +183 -28
  683. package/docs/api/exposure-metering-scene-radiance.md +11 -10
  684. package/docs/api/exposure-metering-target.md +9 -8
  685. package/docs/api/exposure-metering-temporal.md +8 -8
  686. package/docs/api/exposure-metering.md +69 -9
  687. package/docs/api/exposure-program-line.md +6 -5
  688. package/docs/api/facade-chart-radiance-batch.md +96 -0
  689. package/docs/api/facade-chart-scenes.md +240 -0
  690. package/docs/api/facade-scene-radiance.md +122 -0
  691. package/docs/api/facade-simulate-capture.md +324 -0
  692. package/docs/api/gpu-image-kernel-accelerator.md +157 -0
  693. package/docs/api/gpu-image-kernel-execution.md +152 -0
  694. package/docs/api/motion-camera-rotation.md +43 -26
  695. package/docs/api/motion-capture-rotation-inverse-mapping.md +24 -23
  696. package/docs/api/motion-capture-rotation-temporal-quadrature.md +22 -22
  697. package/docs/api/motion-capture-rotation-trajectory.md +15 -15
  698. package/docs/api/motion-capture-translation-parallax-temporal-quadrature.md +15 -14
  699. package/docs/api/motion-extended-object-projection.md +10 -8
  700. package/docs/api/motion-projected-motion.md +8 -8
  701. package/docs/api/motion-temporal-exposure-sum.md +98 -0
  702. package/docs/api/motion-video-sequence.md +159 -0
  703. package/docs/api/optics-aperture.md +8 -8
  704. package/docs/api/optics-atmospheric-haze.md +104 -0
  705. package/docs/api/optics-brown-conrady-distortion.md +123 -0
  706. package/docs/api/optics-circle-of-confusion.md +5 -4
  707. package/docs/api/optics-complex-pupil-psf.md +57 -16
  708. package/docs/api/optics-depth-of-field.md +12 -6
  709. package/docs/api/optics-diffraction.md +8 -7
  710. package/docs/api/optics-focus-breathing.md +104 -16
  711. package/docs/api/optics-focus-state.md +9 -10
  712. package/docs/api/optics-front-of-lens-filter.md +72 -14
  713. package/docs/api/optics-illumination-vignetting.md +10 -10
  714. package/docs/api/optics-irradiance-convolution.md +95 -0
  715. package/docs/api/optics-lateral-chromatic-aberration.md +22 -21
  716. package/docs/api/optics-lens-psf-kernels.md +72 -0
  717. package/docs/api/optics-lens-psf-profile.md +48 -26
  718. package/docs/api/optics-longitudinal-chromatic-aberration.md +128 -0
  719. package/docs/api/optics-polygon-diffraction.md +78 -13
  720. package/docs/api/optics-profile-contract.md +4 -4
  721. package/docs/api/optics-psf-foundation.md +12 -12
  722. package/docs/api/optics-pupil-vignetting.md +132 -0
  723. package/docs/api/optics-radial-distortion.md +12 -12
  724. package/docs/api/optics-scene-to-sensor-irradiance.md +25 -14
  725. package/docs/api/optics-scene-to-sensor-quadrature.md +15 -12
  726. package/docs/api/optics-sensor-aperture-rays.md +3 -2
  727. package/docs/api/optics-sensor-environment-query.md +52 -9
  728. package/docs/api/optics-sensor-psf-quadrature.md +13 -10
  729. package/docs/api/optics-stray-light.md +12 -11
  730. package/docs/api/optics-thin-lens.md +4 -3
  731. package/docs/api/optics-zernike-wavefront.md +229 -0
  732. package/docs/api/output-capture-corrected-sdr.md +10 -7
  733. package/docs/api/output-capture-geometry.md +35 -36
  734. package/docs/api/output-capture-sdr.md +4 -4
  735. package/docs/api/output-crop.md +7 -4
  736. package/docs/api/output-geometric-transforms.md +65 -19
  737. package/docs/api/output-lens-corrections.md +17 -15
  738. package/docs/api/output-native-capture-sdr.md +26 -13
  739. package/docs/api/output-png-encoder.md +105 -0
  740. package/docs/api/output-print-contrast-reference.md +8 -8
  741. package/docs/api/output-print-detail.md +14 -14
  742. package/docs/api/output-print-jpeg.md +22 -5
  743. package/docs/api/output-print-plan.md +18 -18
  744. package/docs/api/output-print-region-statistics.md +14 -14
  745. package/docs/api/output-sdr-rendering.md +52 -10
  746. package/docs/api/output-subject-framing-crop.md +5 -6
  747. package/docs/api/processing-demosaic.md +120 -0
  748. package/docs/api/processing-denoise.md +148 -0
  749. package/docs/api/processing-focus-stacking.md +41 -0
  750. package/docs/api/processing-hdr.md +113 -0
  751. package/docs/api/processing-panorama.md +82 -0
  752. package/docs/api/processing-processing-task.md +107 -0
  753. package/docs/api/processing-tone-mapping.md +142 -0
  754. package/docs/api/schema-camera.md +6 -4
  755. package/docs/api/schema-illumination-spectral.md +10 -11
  756. package/docs/api/schema-illumination-temporal.md +13 -15
  757. package/docs/api/schema-illumination.md +4 -4
  758. package/docs/api/schema-scene-radiance-temporal.md +10 -11
  759. package/docs/api/schema-scene-radiance.md +18 -17
  760. package/docs/api/schema-scene.md +9 -9
  761. package/docs/api/schema-validation.md +1 -1
  762. package/docs/api/sensor-accumulated-charge.md +12 -20
  763. package/docs/api/sensor-architecture.md +15 -16
  764. package/docs/api/sensor-camera-saturation-capacity.md +9 -11
  765. package/docs/api/sensor-capture-color-sampling-binding.md +47 -51
  766. package/docs/api/sensor-capture-mode-timing.md +9 -9
  767. package/docs/api/sensor-capture-mode.md +29 -30
  768. package/docs/api/sensor-color-sampling.md +31 -33
  769. package/docs/api/sensor-constant-rate-temporal-integration.md +10 -11
  770. package/docs/api/sensor-dark-current.md +30 -14
  771. package/docs/api/sensor-environment-photo-signal.md +13 -6
  772. package/docs/api/sensor-eqe-electron-rate.md +9 -8
  773. package/docs/api/sensor-eqe-local-exposure.md +18 -17
  774. package/docs/api/sensor-eqe-temporal-exposure.md +12 -11
  775. package/docs/api/sensor-exposure-window.md +24 -24
  776. package/docs/api/sensor-fixed-pattern-noise.md +104 -0
  777. package/docs/api/sensor-iso-gain.md +63 -0
  778. package/docs/api/sensor-iso-signal-chain.md +13 -22
  779. package/docs/api/sensor-local-exposure-binding.md +12 -13
  780. package/docs/api/sensor-optical-stack.md +37 -40
  781. package/docs/api/sensor-photon-energy.md +10 -11
  782. package/docs/api/sensor-physical-charge-capacity.md +8 -13
  783. package/docs/api/sensor-pixel-pitch.md +1 -1
  784. package/docs/api/sensor-radiometry-readiness.md +9 -9
  785. package/docs/api/sensor-raw-readout.md +118 -52
  786. package/docs/api/sensor-raw-reconstruction.md +97 -20
  787. package/docs/api/sensor-readout-exposure-linkage.md +120 -24
  788. package/docs/api/sensor-readout-timing.md +33 -35
  789. package/docs/api/sensor-response-application-compatibility.md +9 -11
  790. package/docs/api/sensor-response-operating-range.md +14 -18
  791. package/docs/api/sensor-responsivity-photocurrent.md +9 -12
  792. package/docs/api/sensor-sampling-aperture.md +22 -25
  793. package/docs/api/sensor-scene-eqe-temporal-exposure.md +9 -8
  794. package/docs/api/sensor-sensor-geometry.md +23 -24
  795. package/docs/api/sensor-signal-noise.md +10 -10
  796. package/docs/api/sensor-spatial-sample-reduction.md +27 -30
  797. package/docs/api/sensor-spatial-sampling-quadrature.md +37 -39
  798. package/docs/api/sensor-spatio-spectral-reduction.md +27 -29
  799. package/docs/api/sensor-spectral-coverage.md +5 -5
  800. package/docs/api/sensor-spectral-quadrature.md +33 -35
  801. package/docs/api/sensor-spectral-response.md +28 -16
  802. package/docs/api/sensor-temporal-photo-signal.md +6 -6
  803. package/docs/api/simulation-poc-simulation.md +17 -16
  804. package/docs/api/stabilization-camera-shake.md +29 -10
  805. package/docs/api/stabilization-system.md +25 -21
  806. package/docs/examples/production-request.json +3821 -2157
  807. package/docs/examples/simulate-capture.mjs +14 -0
  808. package/llms.txt +35 -0
  809. package/package.json +32 -12
  810. package/AGENTS.md +0 -674
  811. package/CONTRIBUTING.md +0 -76
  812. package/DCO +0 -33
  813. package/dist/camera/equivalent-focal-length.d.ts.map +0 -1
  814. package/dist/camera/field-of-view.d.ts.map +0 -1
  815. package/dist/camera/projected-object-size.d.ts.map +0 -1
  816. package/dist/capture/capture-export-metadata.d.ts.map +0 -1
  817. package/dist/capture/environment-raw-producer.d.ts.map +0 -1
  818. package/dist/capture/export-jpeg.d.ts.map +0 -1
  819. package/dist/capture/export-tiff.d.ts.map +0 -1
  820. package/dist/capture/focus-control.d.ts.map +0 -1
  821. package/dist/capture/linear-encoding.d.ts.map +0 -1
  822. package/dist/capture/native-environment-raw.d.ts.map +0 -1
  823. package/dist/capture/native-raw-development.d.ts.map +0 -1
  824. package/dist/capture/native-raw.d.ts.map +0 -1
  825. package/dist/capture/photographic-export.d.ts.map +0 -1
  826. package/dist/capture/raw-frame-limits.d.ts.map +0 -1
  827. package/dist/capture/raw-frame-reconstruction.d.ts.map +0 -1
  828. package/dist/capture/release-sequence.d.ts.map +0 -1
  829. package/dist/capture/sensor-raw-frame.d.ts.map +0 -1
  830. package/dist/capture/sensor-raw-producer.d.ts.map +0 -1
  831. package/dist/capture/simulated-capture.d.ts.map +0 -1
  832. package/dist/color/capture-color.d.ts.map +0 -1
  833. package/dist/color/sensor-color-development.d.ts.map +0 -1
  834. package/dist/color/srgb-icc.d.ts.map +0 -1
  835. package/dist/color/srgb-transfer.d.ts.map +0 -1
  836. package/dist/color/white-balance.d.ts.map +0 -1
  837. package/dist/composition/image-formation-plan.d.ts.map +0 -1
  838. package/dist/composition/plan-consumer.d.ts.map +0 -1
  839. package/dist/core/calculation-result.d.ts.map +0 -1
  840. package/dist/core/canonical-json.d.ts.map +0 -1
  841. package/dist/core/configuration-error.d.ts.map +0 -1
  842. package/dist/core/evidence-provenance.d.ts.map +0 -1
  843. package/dist/core/image-formation.d.ts.map +0 -1
  844. package/dist/core/owned-data.d.ts.map +0 -1
  845. package/dist/core/record-validation.d.ts.map +0 -1
  846. package/dist/core/scientific-assurance.d.ts.map +0 -1
  847. package/dist/core/spectral-composition.d.ts.map +0 -1
  848. package/dist/core/spectral.d.ts.map +0 -1
  849. package/dist/core/validation.d.ts.map +0 -1
  850. package/dist/core/version.d.ts.map +0 -1
  851. package/dist/equipment/exposure-capabilities.d.ts.map +0 -1
  852. package/dist/equipment/generic-tier-assets.d.ts.map +0 -1
  853. package/dist/equipment/generic-tier-presets.d.ts.map +0 -1
  854. package/dist/equipment/iso-capabilities.d.ts.map +0 -1
  855. package/dist/equipment/metering-capabilities.d.ts.map +0 -1
  856. package/dist/equipment/release-capabilities.d.ts.map +0 -1
  857. package/dist/exposure/exposure-duration-control.d.ts.map +0 -1
  858. package/dist/exposure/exposure-mode-resolver.d.ts.map +0 -1
  859. package/dist/exposure/exposure.d.ts.map +0 -1
  860. package/dist/exposure/flash.d.ts.map +0 -1
  861. package/dist/exposure/metering-scene-radiance.d.ts.map +0 -1
  862. package/dist/exposure/metering-target.d.ts.map +0 -1
  863. package/dist/exposure/metering-temporal.d.ts.map +0 -1
  864. package/dist/exposure/metering.d.ts.map +0 -1
  865. package/dist/exposure/program-line.d.ts.map +0 -1
  866. package/dist/index.d.ts.map +0 -1
  867. package/dist/motion/camera-rotation.d.ts.map +0 -1
  868. package/dist/motion/capture-rotation-inverse-mapping.d.ts.map +0 -1
  869. package/dist/motion/capture-rotation-temporal-quadrature.d.ts.map +0 -1
  870. package/dist/motion/capture-rotation-trajectory.d.ts.map +0 -1
  871. package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts.map +0 -1
  872. package/dist/motion/extended-object-projection.d.ts.map +0 -1
  873. package/dist/motion/projected-motion.d.ts.map +0 -1
  874. package/dist/optics/aperture.d.ts.map +0 -1
  875. package/dist/optics/circle-of-confusion.d.ts.map +0 -1
  876. package/dist/optics/complex-pupil-psf.d.ts.map +0 -1
  877. package/dist/optics/depth-of-field.d.ts.map +0 -1
  878. package/dist/optics/diffraction.d.ts.map +0 -1
  879. package/dist/optics/focus-breathing.d.ts.map +0 -1
  880. package/dist/optics/focus-state.d.ts.map +0 -1
  881. package/dist/optics/front-of-lens-filter.d.ts.map +0 -1
  882. package/dist/optics/illumination-vignetting.d.ts.map +0 -1
  883. package/dist/optics/lateral-chromatic-aberration.d.ts.map +0 -1
  884. package/dist/optics/lens-psf-profile.d.ts.map +0 -1
  885. package/dist/optics/polygon-diffraction.d.ts.map +0 -1
  886. package/dist/optics/profile-contract.d.ts.map +0 -1
  887. package/dist/optics/psf-foundation.d.ts.map +0 -1
  888. package/dist/optics/radial-distortion.d.ts.map +0 -1
  889. package/dist/optics/scene-to-sensor-irradiance.d.ts.map +0 -1
  890. package/dist/optics/scene-to-sensor-quadrature.d.ts.map +0 -1
  891. package/dist/optics/sensor-aperture-rays.d.ts.map +0 -1
  892. package/dist/optics/sensor-environment-query.d.ts.map +0 -1
  893. package/dist/optics/sensor-psf-quadrature.d.ts.map +0 -1
  894. package/dist/optics/sensor-psf-support.d.ts.map +0 -1
  895. package/dist/optics/stray-light.d.ts.map +0 -1
  896. package/dist/optics/thin-lens.d.ts.map +0 -1
  897. package/dist/output/capture-corrected-sdr.d.ts.map +0 -1
  898. package/dist/output/capture-geometry.d.ts.map +0 -1
  899. package/dist/output/capture-sdr.d.ts.map +0 -1
  900. package/dist/output/crop.d.ts.map +0 -1
  901. package/dist/output/geometric-transforms.d.ts.map +0 -1
  902. package/dist/output/lens-corrections.d.ts.map +0 -1
  903. package/dist/output/native-capture-sdr.d.ts.map +0 -1
  904. package/dist/output/print-contrast-reference.d.ts.map +0 -1
  905. package/dist/output/print-detail.d.ts.map +0 -1
  906. package/dist/output/print-jpeg.d.ts.map +0 -1
  907. package/dist/output/print-plan.d.ts.map +0 -1
  908. package/dist/output/print-region-statistics.d.ts.map +0 -1
  909. package/dist/output/sdr-rendering.d.ts.map +0 -1
  910. package/dist/output/subject-framing-crop.d.ts.map +0 -1
  911. package/dist/schema/camera.d.ts.map +0 -1
  912. package/dist/schema/camera.js +0 -3
  913. package/dist/schema/camera.js.map +0 -1
  914. package/dist/schema/illumination-spectral.d.ts.map +0 -1
  915. package/dist/schema/illumination-temporal.d.ts.map +0 -1
  916. package/dist/schema/illumination.d.ts.map +0 -1
  917. package/dist/schema/scene-radiance-temporal.d.ts.map +0 -1
  918. package/dist/schema/scene-radiance.d.ts.map +0 -1
  919. package/dist/schema/scene.d.ts.map +0 -1
  920. package/dist/schema/scene.js +0 -3
  921. package/dist/schema/scene.js.map +0 -1
  922. package/dist/schema/validation.d.ts.map +0 -1
  923. package/dist/sensor/accumulated-charge.d.ts.map +0 -1
  924. package/dist/sensor/architecture.d.ts.map +0 -1
  925. package/dist/sensor/camera-saturation-capacity.d.ts.map +0 -1
  926. package/dist/sensor/capture-color-sampling-binding.d.ts.map +0 -1
  927. package/dist/sensor/capture-mode-timing.d.ts.map +0 -1
  928. package/dist/sensor/capture-mode.d.ts.map +0 -1
  929. package/dist/sensor/color-sampling.d.ts.map +0 -1
  930. package/dist/sensor/constant-rate-temporal-integration.d.ts.map +0 -1
  931. package/dist/sensor/dark-current.d.ts.map +0 -1
  932. package/dist/sensor/environment-photo-signal.d.ts.map +0 -1
  933. package/dist/sensor/eqe-electron-rate.d.ts.map +0 -1
  934. package/dist/sensor/eqe-local-exposure.d.ts.map +0 -1
  935. package/dist/sensor/eqe-temporal-exposure.d.ts.map +0 -1
  936. package/dist/sensor/exposure-window.d.ts.map +0 -1
  937. package/dist/sensor/iso-signal-chain.d.ts.map +0 -1
  938. package/dist/sensor/local-exposure-binding.d.ts.map +0 -1
  939. package/dist/sensor/optical-stack.d.ts.map +0 -1
  940. package/dist/sensor/photon-energy.d.ts.map +0 -1
  941. package/dist/sensor/physical-charge-capacity.d.ts.map +0 -1
  942. package/dist/sensor/pixel-pitch.d.ts.map +0 -1
  943. package/dist/sensor/radiometry-readiness.d.ts.map +0 -1
  944. package/dist/sensor/raw-readout.d.ts.map +0 -1
  945. package/dist/sensor/raw-reconstruction.d.ts.map +0 -1
  946. package/dist/sensor/readout-exposure-linkage.d.ts.map +0 -1
  947. package/dist/sensor/readout-timing.d.ts.map +0 -1
  948. package/dist/sensor/response-application-compatibility.d.ts.map +0 -1
  949. package/dist/sensor/response-operating-range.d.ts.map +0 -1
  950. package/dist/sensor/responsivity-photocurrent.d.ts.map +0 -1
  951. package/dist/sensor/sampling-aperture.d.ts.map +0 -1
  952. package/dist/sensor/scene-eqe-temporal-exposure.d.ts.map +0 -1
  953. package/dist/sensor/sensor-geometry.d.ts.map +0 -1
  954. package/dist/sensor/signal-noise.d.ts.map +0 -1
  955. package/dist/sensor/spatial-sample-reduction.d.ts.map +0 -1
  956. package/dist/sensor/spatial-sampling-quadrature.d.ts.map +0 -1
  957. package/dist/sensor/spatio-spectral-reduction.d.ts.map +0 -1
  958. package/dist/sensor/spectral-coverage.d.ts.map +0 -1
  959. package/dist/sensor/spectral-quadrature.d.ts.map +0 -1
  960. package/dist/sensor/spectral-response.d.ts.map +0 -1
  961. package/dist/sensor/temporal-eqe-sum.d.ts.map +0 -1
  962. package/dist/sensor/temporal-photo-signal.d.ts.map +0 -1
  963. package/dist/sensor/temporal-sample-binding.d.ts.map +0 -1
  964. package/dist/simulation/poc-simulation.d.ts.map +0 -1
  965. package/dist/stabilization/camera-shake.d.ts.map +0 -1
  966. package/dist/stabilization/system.d.ts.map +0 -1
  967. package/docs/API_STYLE.md +0 -235
  968. package/docs/ARCHITECTURE.md +0 -356
  969. package/docs/AUTOMATION_COORDINATION.md +0 -190
  970. package/docs/CAPTURE_COLOR.md +0 -25
  971. package/docs/CAPTURE_CORRECTED_SDR.md +0 -25
  972. package/docs/CAPTURE_EXPORT_METADATA.md +0 -27
  973. package/docs/CAPTURE_SDR.md +0 -22
  974. package/docs/DEVELOPERS.md +0 -68
  975. package/docs/DIGITAL_OPTICS_FOUNDATION.md +0 -69
  976. package/docs/ENVIRONMENT_RAW_CAPTURE.md +0 -208
  977. package/docs/EXPORT_ACCEPTANCE.md +0 -133
  978. package/docs/GENERIC_TIER_PRESETS.md +0 -269
  979. package/docs/GEOMETRIC_PREPARATION_REUSE.md +0 -141
  980. package/docs/IMAGE_FORMATION.md +0 -247
  981. package/docs/LINEAR_CAPTURE_ENCODING.md +0 -25
  982. package/docs/MOTION_AND_SIGNAL.md +0 -250
  983. package/docs/NATIVE_CAPTURE_SDR.md +0 -70
  984. package/docs/NATIVE_CAPTURE_SDR_REVIEW.md +0 -37
  985. package/docs/NATIVE_CAPTURE_SDR_VALIDATION.md +0 -34
  986. package/docs/NATIVE_RAW_AND_PRINT.md +0 -47
  987. package/docs/NUMERICAL_CORRECTNESS.md +0 -191
  988. package/docs/PERFORMANCE_BASELINE.md +0 -56
  989. package/docs/PHOTOGRAPHIC_EXPORT.md +0 -206
  990. package/docs/PHYSICS_FOUNDATION.md +0 -426
  991. package/docs/POC_API.md +0 -278
  992. package/docs/POC_PROJECTION_PLATFORM_REFERENCE.md +0 -12
  993. package/docs/POC_PROJECTION_REUSE.md +0 -124
  994. package/docs/PRINT_195_196_REVIEW.md +0 -93
  995. package/docs/PRINT_196_ENGINE_ACCEPTANCE.md +0 -45
  996. package/docs/PRINT_CONTRAST_REFERENCE.md +0 -43
  997. package/docs/PRINT_DETAIL_ASSESSMENT.md +0 -81
  998. package/docs/PRINT_DETAIL_JPEG_EVIDENCE.md +0 -36
  999. package/docs/PRINT_DETAIL_SDR_EVIDENCE.md +0 -29
  1000. package/docs/PRINT_DETAIL_VALIDATION.md +0 -36
  1001. package/docs/PRINT_PLANNING.md +0 -75
  1002. package/docs/PRINT_REGION_STATISTICS.md +0 -38
  1003. package/docs/PROCESSED_OUTPUT.md +0 -157
  1004. package/docs/PRODUCTION_COMPOSITION.md +0 -373
  1005. package/docs/PRODUCTION_ENVIRONMENT_CAPTURE.md +0 -131
  1006. package/docs/PROVENANCE.md +0 -115
  1007. package/docs/PSF_FOUNDATION.md +0 -165
  1008. package/docs/RAW_FRAME_ENVELOPE.md +0 -56
  1009. package/docs/RAW_FRAME_RECONSTRUCTION.md +0 -30
  1010. package/docs/RELEASE_1_0.md +0 -66
  1011. package/docs/RELEASE_1_0_1.md +0 -61
  1012. package/docs/RELEASE_1_1_0.md +0 -25
  1013. package/docs/RELEASE_1_2_0.md +0 -51
  1014. package/docs/RELEASE_1_3_0.md +0 -15
  1015. package/docs/RELEASE_1_4_0.md +0 -23
  1016. package/docs/RELEASE_AUDIT.md +0 -39
  1017. package/docs/SCENE_RADIANCE_AND_ILLUMINATION.md +0 -298
  1018. package/docs/SCENE_SENSOR_QUADRATURE.md +0 -98
  1019. package/docs/SCENE_SENSOR_TEMPORAL_EXPOSURE.md +0 -86
  1020. package/docs/SCIENTIFIC_ASSURANCE.md +0 -280
  1021. package/docs/SCIENTIFIC_CONFORMANCE.md +0 -83
  1022. package/docs/SDR_RENDERING.md +0 -33
  1023. package/docs/SENSOR_APERTURE_RAYS.md +0 -23
  1024. package/docs/SENSOR_ENVIRONMENT_QUERY.md +0 -86
  1025. package/docs/SENSOR_EQE_LOCAL_EXPOSURE.md +0 -104
  1026. package/docs/SENSOR_EQE_TEMPORAL_EXPOSURE.md +0 -74
  1027. package/docs/SENSOR_PSF_QUADRATURE.md +0 -90
  1028. package/docs/SENSOR_RAW_FRAME.md +0 -20
  1029. package/docs/SENSOR_RAW_PRODUCER.md +0 -77
  1030. package/docs/SIGNAL_CONFORMANCE.md +0 -23
  1031. package/docs/SIMULATED_CAPTURE.md +0 -65
  1032. package/docs/STABILIZATION.md +0 -234
  1033. package/docs/TEMPORAL_PHOTO_RAW.md +0 -83
  1034. package/docs/TIER_ACCEPTANCE.md +0 -129
  1035. package/docs/TIER_PRESET_ACCEPTANCE.md +0 -59
  1036. package/docs/V1_COMPOSITION_MAP.md +0 -123
  1037. package/docs/V1_HELPER_REUSE_REVIEW.md +0 -60
  1038. package/docs/V1_PERFORMANCE_DISPOSITION.md +0 -88
  1039. package/docs/benchmarks/2026-10-01-main-baseline.json +0 -694
  1040. package/docs/benchmarks/2026-10-02-geometric-preparation-reuse.json +0 -2190
  1041. package/docs/benchmarks/2026-10-02-poc-projection-reuse.json +0 -2423
  1042. package/docs/benchmarks/2026-10-02-v1-environment-gc-profile.json +0 -210
  1043. package/docs/benchmarks/2026-10-02-v1-environment-ordinary.json +0 -187
  1044. package/docs/benchmarks/2026-10-02-v1-geometry-gc-profile.json +0 -756
  1045. package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-1.json +0 -711
  1046. package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-2.json +0 -711
  1047. package/docs/benchmarks/2026-10-02-v1-poc-gc-profile.json +0 -885
  1048. package/docs/benchmarks/2026-10-02-v1-poc-ordinary-1.json +0 -868
  1049. package/docs/benchmarks/2026-10-02-v1-poc-ordinary-2.json +0 -868
  1050. package/docs/licenses/castleCSF-MIT.txt +0 -21
  1051. package/docs/validation/documentation-fragments.json +0 -212
  1052. package/docs/validation/native-capture-sdr-darwin-arm64-node26-review.jsonl +0 -4
  1053. package/docs/validation/native-capture-sdr-darwin-arm64.jsonl +0 -3
  1054. package/docs/validation/native-raw-print-2026-10-04/fractional-asymmetric-crop.jpg +0 -0
  1055. package/docs/validation/native-raw-print-2026-10-04/gray-ramp.jpg +0 -0
  1056. package/docs/validation/native-raw-print-2026-10-04/linear-area-checker.jpg +0 -0
  1057. package/docs/validation/native-raw-print-2026-10-04/manifest.json +0 -218
  1058. package/docs/validation/native-raw-print-2026-10-04/megapixel-native.jpg +0 -0
  1059. package/docs/validation/native-raw-print-2026-10-04/native-color.jpg +0 -0
  1060. package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel-validation.json +0 -9
  1061. package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json +0 -29
  1062. package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.codes.u16le.gz +0 -0
  1063. package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.jpg +0 -0
  1064. package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.rgb.gz +0 -0
  1065. package/docs/validation/native-raw-print-2026-10-04/srgb.icc +0 -0
  1066. package/docs/validation/native-raw-print-2026-10-04/validation.json +0 -41
  1067. package/docs/validation/print-196-candidate-capabilities.json +0 -28
  1068. package/docs/validation/print-196-candidate-evidence.json +0 -356
  1069. package/docs/validation/print-196-engine-acceptance.json +0 -81
  1070. package/docs/validation/print-detail-capabilities.json +0 -103
  1071. package/docs/validation/print-detail-jpeg-evidence.json +0 -116
  1072. package/docs/validation/print-detail-sdr-evidence.json +0 -81
  1073. package/docs/validation/release-audit-inventory.json +0 -1306
  1074. package/docs/validation/tier-acceptance-report-v1.json +0 -2538
@@ -1,17 +1,12 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  /**
3
- * Module boundary and integration notes.
4
- * Validate an untrusted declaration and return the normalized typed contract. Unknown enum values,
5
- * missing required fields and incompatible scientific data fail at this boundary. Focus is a
6
- * longitudinal plane or explicit infinity state, never a screen-space distance. The ideal actuator
7
- * resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring scale or
8
- * acquisition latency. Target loss, reacquisition, focus lock and release priority remain separate
9
- * state transitions.
10
- * Create the initial ideal focus-controller state from an explicit profile, focus plane and public
11
- * state identity. Focus is a longitudinal plane or explicit infinity state, never a screen-space
12
- * distance. The ideal actuator resolves supplied target observations; it does not infer a commercial
13
- * AF sensor, focus-ring scale or acquisition latency. Target loss, reacquisition, focus lock and
14
- * release priority remain separate state transitions.
3
+ * Focus control: manual focus (MF), single autofocus (AF-S) and continuous autofocus (AF-C), focus
4
+ * lock, and the focus-priority or release-priority check before the shutter fires.
5
+ *
6
+ * Focus is always a distance along the optical axis (a focus plane) or infinity, never a distance
7
+ * on screen. The focus "actuator" is ideal: it focuses on the target observations it is given. It
8
+ * does not model a real AF sensor, a focus-ring scale or how long focusing takes. Losing a target,
9
+ * reacquiring it, locking focus and the release-priority decision are separate state changes.
15
10
  * @see docs/SIMULATED_CAPTURE.md for equations, coordinate/unit conventions, blockers and support
16
11
  * limits.
17
12
  */
@@ -19,6 +14,7 @@ import { InvalidConfigurationError } from "../core/configuration-error.js";
19
14
  import { parseEvidenceList } from "../core/evidence-provenance.js";
20
15
  import { InvalidScientificInputError } from "../core/validation.js";
21
16
  import { parseFocusPlane } from "../optics/focus-state.js";
17
+ import { requireInputObject, requireInputKeys, rejectUnknownFields } from "../core/record-validation.js";
22
18
  export const FOCUS_CONTROL_PROFILE_SCHEMA_VERSION = "0.1.0";
23
19
  export const FOCUS_CONTROL_STATE_VERSION = "0.1.0";
24
20
  const FOCUS_MODES = new Set([
@@ -37,12 +33,14 @@ const TARGET_LOSS_REASONS = new Set([
37
33
  "identity-lost",
38
34
  "outside-focus-area"
39
35
  ]);
40
- function requireRecord(value, path) {
36
+ function requireRecord(value, path, allowedKeys) {
41
37
  if (typeof value !== "object" ||
42
38
  value === null ||
43
39
  Array.isArray(value)) {
44
40
  throw new InvalidConfigurationError(path + " must be an object.");
45
41
  }
42
+ if (allowedKeys !== null)
43
+ rejectUnknownFields(value, allowedKeys, path);
46
44
  return value;
47
45
  }
48
46
  function requireNonEmptyString(value, path) {
@@ -56,7 +54,7 @@ function requireNonEmptyString(value, path) {
56
54
  function requireScientificNonEmptyString(value, path) {
57
55
  if (typeof value !== "string" ||
58
56
  value.trim().length === 0) {
59
- throw new InvalidScientificInputError(path +
57
+ throw new InvalidConfigurationError(path +
60
58
  " must be a non-empty string.");
61
59
  }
62
60
  return value.trim();
@@ -119,20 +117,19 @@ function parseUniqueEnumList(value, path, allowed) {
119
117
  return parsed;
120
118
  }
121
119
  /**
122
- * Validate an untrusted declaration and return the normalized typed contract. Unknown enum values,
123
- * missing required fields and incompatible scientific data fail at this boundary.
120
+ * Validates an untrusted focus-control profile and returns it normalized. Unknown enum values,
121
+ * missing required fields and inconsistent scientific data are rejected.
124
122
  *
125
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
126
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
127
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
128
- * separate state transitions.
129
- * @param value - unknown. Treated as untrusted data; static typing alone is not validation.
130
- * @returns FocusControlProfile. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
123
+ * Focus is a distance along the optical axis or infinity, never a distance on screen. The ideal
124
+ * actuator focuses on the target observations it is given. It does not model a real AF sensor, a
125
+ * focus-ring scale or focusing time.
126
+ * @param value - Untrusted data. TypeScript types alone are not validation.
127
+ * @returns The validated profile. Success does not imply calibration.
131
128
  *
132
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
129
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
133
130
  */
134
131
  export function parseFocusControlProfile(value) {
135
- const record = requireRecord(value, "focusControlProfile");
132
+ const record = requireRecord(value, "focusControlProfile", ["schemaVersion", "scientificStatus", "actuator", "continuousTargetLossPolicy", "profileId", "profileVersion", "supportedModes", "supportedReleasePriorities", "evidence", "limitations"]);
136
133
  if (record.schemaVersion !==
137
134
  FOCUS_CONTROL_PROFILE_SCHEMA_VERSION) {
138
135
  throw new InvalidConfigurationError('focusControlProfile.schemaVersion must be "' +
@@ -143,7 +140,7 @@ export function parseFocusControlProfile(value) {
143
140
  "approximation") {
144
141
  throw new InvalidConfigurationError('focusControlProfile.scientificStatus must be "approximation".');
145
142
  }
146
- const actuator = requireRecord(record.actuator, "focusControlProfile.actuator");
143
+ const actuator = requireRecord(record.actuator, "focusControlProfile.actuator", ["kind", "evidence"]);
147
144
  if (actuator.kind !==
148
145
  "ideal-instantaneous") {
149
146
  throw new InvalidConfigurationError('focusControlProfile.actuator.kind must be "ideal-instantaneous" in schema 0.1.0.');
@@ -264,19 +261,15 @@ function verifyStateProfile(state, profile) {
264
261
  }
265
262
  }
266
263
  /**
267
- * Create the initial ideal focus-controller state from an explicit profile, focus plane and public
268
- * state identity.
269
- *
270
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
271
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
272
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
273
- * separate state transitions.
274
- * @param input - CreateFocusControlStateInput. See the linked contract for coordinate, unit and profile binding semantics.
275
- * @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
264
+ * Creates the initial ideal focus-controller state from a profile, a focus plane and a public
265
+ * state ID.
266
+ * @param input - New state ID, profile, focus mode, initial focus plane and optional start time.
267
+ * @returns The initial state. Success does not imply calibration.
276
268
  *
277
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
269
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
278
270
  */
279
271
  export function createFocusControlState(input) {
272
+ requireInputKeys(input, "createFocusControlState", ["stateId", "profile", "mode", "initialFocus", "initialTimeSeconds"]);
280
273
  const profile = parseFocusControlProfile(input.profile);
281
274
  requireSupportedMode(profile, input.mode);
282
275
  const time = input.initialTimeSeconds ===
@@ -312,19 +305,16 @@ function stateProfileView(state) {
312
305
  };
313
306
  }
314
307
  /**
315
- * Return a manual focus transition to the supplied finite/infinity plane without inventing a lens
316
- * actuator or focus-ring conversion.
308
+ * Returns the state after manually focusing on the given finite or infinity plane. No lens
309
+ * actuator or focus-ring conversion is modelled.
310
+ * @param input - Current state, new state ID, new focus plane and event time.
311
+ * @returns The new state. Success does not imply calibration.
317
312
  *
318
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
319
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
320
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
321
- * separate state transitions.
322
- * @param input - SetManualFocusStateInput. See the linked contract for coordinate, unit and profile binding semantics.
323
- * @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
324
- *
325
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
313
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
326
314
  */
327
315
  export function setManualFocusState(input) {
316
+ requireInputKeys(input, "setManualFocusState", ["state", "stateId", "focus", "eventTimeSeconds", "commandId"]);
317
+ requireInputObject(input.state, "state");
328
318
  if (input.state.mode !==
329
319
  "manual") {
330
320
  throw new InvalidScientificInputError("setManualFocusState requires manual focus mode.");
@@ -393,7 +383,7 @@ function parseObservation(observation) {
393
383
  reason: observation.reason
394
384
  };
395
385
  }
396
- throw new InvalidScientificInputError("observation.kind/reason is invalid.");
386
+ throw new InvalidConfigurationError("observation.kind/reason is invalid.");
397
387
  }
398
388
  function focusFromObservation(observation) {
399
389
  if (observation.kind ===
@@ -444,22 +434,21 @@ function unchangedResolution(input) {
444
434
  };
445
435
  }
446
436
  /**
447
- * Resolve an explicit available/lost target observation under the selected single/continuous AF
448
- * policy, retaining acquisition and reacquisition disposition.
437
+ * Applies one target observation (target available or lost) under the selected AF-S or AF-C
438
+ * policy, and records whether the target was acquired or reacquired.
449
439
  *
450
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
451
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
452
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
453
- * separate state transitions.
454
- * @param input - ResolveFocusTargetObservationInput. See the linked contract for coordinate, unit and profile binding semantics.
455
- * @returns FocusTargetResolution. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
440
+ * The ideal actuator focuses on the observation as given. Target loss, reacquisition, focus
441
+ * lock and release priority are separate state changes.
442
+ * @param input - Current state, new state ID, control event and target observation.
443
+ * @returns The resolution and new state. Success does not imply calibration.
456
444
  *
457
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
445
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
458
446
  */
459
447
  export function resolveFocusTargetObservation(input) {
448
+ requireInputKeys(input, "resolveFocusTargetObservation", ["state", "stateId", "event", "observation"]);
460
449
  if (input.event !== "acquire" &&
461
450
  input.event !== "update") {
462
- throw new InvalidScientificInputError('Focus target event must be "acquire" or "update".');
451
+ throw new InvalidConfigurationError('Focus target event must be "acquire" or "update".');
463
452
  }
464
453
  if (input.state.mode ===
465
454
  "manual") {
@@ -535,18 +524,14 @@ export function resolveFocusTargetObservation(input) {
535
524
  return stateFromResolvedTarget(input, observation);
536
525
  }
537
526
  /**
538
- * Return an explicit lock/unlock transition without changing the underlying physical focus plane.
539
- *
540
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
541
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
542
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
543
- * separate state transitions.
544
- * @param input - SetFocusLockInput. See the linked contract for coordinate, unit and profile binding semantics.
545
- * @returns FocusControlState. Return shape and scientific status are explicit; no calibration is inferred from successful execution.
527
+ * Locks or unlocks focus. The physical focus plane does not change.
528
+ * @param input - Current state, new state ID, lock setting and event time.
529
+ * @returns The new state. Success does not imply calibration.
546
530
  *
547
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
531
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
548
532
  */
549
533
  export function setFocusLock(input) {
534
+ requireInputKeys(input, "setFocusLock", ["state", "stateId", "locked", "eventTimeSeconds"]);
550
535
  const time = requireMonotonicEventTime(input.state, input.eventTimeSeconds);
551
536
  if (input.locked) {
552
537
  if (input.state.locked) {
@@ -575,19 +560,15 @@ export function setFocusLock(input) {
575
560
  .activeFocusAreaId);
576
561
  }
577
562
  /**
578
- * Report whether release may proceed under focus-priority or release-priority policy; this does not
579
- * operate a shutter.
580
- *
581
- * Focus is a longitudinal plane or explicit infinity state, never a screen-space distance. The ideal
582
- * actuator resolves supplied target observations; it does not infer a commercial AF sensor, focus-ring
583
- * scale or acquisition latency. Target loss, reacquisition, focus lock and release priority remain
584
- * separate state transitions.
585
- * @param input - AssessFocusReleaseGateInput. See the linked contract for coordinate, unit and profile binding semantics.
586
- * @returns FocusReleaseGateAssessment. Read structured blockers before consuming an authorization.
563
+ * Reports whether the shutter may be released under the focus-priority or release-priority
564
+ * policy. It does not operate the shutter.
565
+ * @param input - Current state, profile and release priority.
566
+ * @returns The assessment. Read its structured blockers before acting on an authorization.
587
567
  *
588
- * @see docs/API_REFERENCE.md for the root export and exact type graph.
568
+ * @see docs/API_REFERENCE.md for the package export and its full type definitions.
589
569
  */
590
570
  export function assessFocusReleaseGate(input) {
571
+ requireInputKeys(input, "assessFocusReleaseGate", ["state", "profile", "priority"]);
591
572
  const profile = parseFocusControlProfile(input.profile);
592
573
  verifyStateProfile(input.state, profile);
593
574
  if (!profile
@@ -1 +1 @@
1
- {"version":3,"file":"focus-control.js","sourceRoot":"","sources":["../../src/capture/focus-control.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,CAAC,MAAM,oCAAoC,GAC/C,OAAgB,CAAC;AACnB,MAAM,CAAC,MAAM,2BAA2B,GACtC,OAAgB,CAAC;AA+MnB,MAAM,WAAW,GACf,IAAI,GAAG,CAAmB;IACxB,QAAQ;IACR,WAAW;IACX,eAAe;CAChB,CAAC,CAAC;AAEL,MAAM,kBAAkB,GACtB,IAAI,GAAG,CAAuB;IAC5B,gBAAgB;IAChB,kBAAkB;IAClB,UAAU;CACX,CAAC,CAAC;AAEL,MAAM,mBAAmB,GACvB,IAAI,GAAG,CAAwB;IAC7B,UAAU;IACV,cAAc;IACd,eAAe;IACf,oBAAoB;CACrB,CAAC,CAAC;AAEL,SAAS,aAAa,CACpB,KAAc,EACd,IAAY;IAEZ,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;QACD,MAAM,IAAI,yBAAyB,CACjC,I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,KAAK;SACR,gBAAgB;QACnB,UAAU,EACV,CAAC;QACD,OAAO;YACL,QAAQ,EACN,KAAK,CAAC,QAAQ;YAChB,iBAAiB,EAAE,IAAI;YACvB,MAAM,EACJ,gBAAgB;YAClB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EACN,KAAK,CAAC,QAAQ;QAChB,iBAAiB,EAAE,KAAK;QACxB,MAAM,EACJ,oBAAoB;QACtB,qCAAqC,EACnC,KAAK;QACP,oBAAoB,EAClB,KAAK;QACP,gBAAgB,EACd,KAAK;KACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"focus-control.js","sourceRoot":"","sources":["../../src/capture/focus-control.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAIzG,MAAM,CAAC,MAAM,oCAAoC,GAC/C,OAAgB,CAAC;AACnB,MAAM,CAAC,MAAM,2BAA2B,GACtC,OAAgB,CAAC;AAgNnB,MAAM,WAAW,GACf,IAAI,GAAG,CAAmB;IACxB,QAAQ;IACR,WAAW;IACX,eAAe;CAChB,CAAC,CAAC;AAEL,MAAM,kBAAkB,GACtB,IAAI,GAAG,CAAuB;IAC5B,gBAAgB;IAChB,kBAAkB;IAClB,UAAU;CACX,CAAC,CAAC;AAEL,MAAM,mBAAmB,GACvB,IAAI,GAAG,CAAwB;IAC7B,UAAU;IACV,cAAc;IACd,eAA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AAE,IAAI;YACvB,MAAM,EACJ,gBAAgB;YAClB,qCAAqC,EACnC,KAAK;YACP,oBAAoB,EAClB,KAAK;YACP,gBAAgB,EACd,KAAK;SACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EACN,KAAK,CAAC,QAAQ;QAChB,iBAAiB,EAAE,KAAK;QACxB,MAAM,EACJ,oBAAoB;QACtB,qCAAqC,EACnC,KAAK;QACP,oBAAoB,EAClB,KAAK;QACP,gBAAgB,EACd,KAAK;KACR,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Focus control: manual focus (MF), single autofocus (AF-S) and continuous autofocus (AF-C), focus\n * lock, and the focus-priority or release-priority check before the shutter fires.\n *\n * Focus is always a distance along the optical axis (a focus plane) or infinity, never a distance\n * on screen. The focus \"actuator\" is ideal: it focuses on the target observations it is given. It\n * does not model a real AF sensor, a focus-ring scale or how long focusing takes. Losing a target,\n * reacquiring it, locking focus and the release-priority decision are separate state changes.\n * @see docs/SIMULATED_CAPTURE.md for equations, coordinate/unit conventions, blockers and support\n * limits.\n */\n\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\nimport {\n parseEvidenceList,\n type EvidenceProvenance\n} from \"../core/evidence-provenance.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport {\n parseFocusPlane,\n type FocusPlane\n} from \"../optics/focus-state.js\";\nimport { requireInputObject, requireInputKeys, rejectUnknownFields } from \"../core/record-validation.js\";\n\ntype UnknownRecord = Record<string, unknown>;\n\nexport const FOCUS_CONTROL_PROFILE_SCHEMA_VERSION =\n \"0.1.0\" as const;\nexport const FOCUS_CONTROL_STATE_VERSION =\n \"0.1.0\" as const;\n\nexport type FocusControlMode =\n | \"manual\"\n | \"single-af\"\n | \"continuous-af\";\n\nexport type FocusAcquisitionState =\n | \"idle\"\n | \"acquiring\"\n | \"acquired\"\n | \"target-lost\"\n | \"locked\";\n\nexport type FocusReleasePriority =\n | \"focus-priority\"\n | \"release-priority\"\n | \"balanced\";\n\nexport type FocusTargetLossReason =\n | \"occluded\"\n | \"out-of-frame\"\n | \"identity-lost\"\n | \"outside-focus-area\";\n\nexport interface FocusControlProfile {\n schemaVersion:\n typeof FOCUS_CONTROL_PROFILE_SCHEMA_VERSION;\n profileId: string;\n profileVersion: string;\n scientificStatus: \"approximation\";\n supportedModes:\n readonly FocusControlMode[];\n actuator: {\n kind: \"ideal-instantaneous\";\n evidence:\n readonly EvidenceProvenance[];\n };\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\";\n supportedReleasePriorities:\n readonly FocusReleasePriority[];\n evidence:\n readonly EvidenceProvenance[];\n limitations: readonly string[];\n}\n\ninterface FocusTargetObservationBase {\n targetId: string;\n focusAreaId?: string;\n observedAtSeconds: number;\n}\n\nexport type FocusTargetObservation =\n | (FocusTargetObservationBase & {\n kind: \"finite-surface\";\n /**\n * Distance along the camera's optical axis (the same convention as\n * FocusPlane), not the renderer's ray length to the point.\n */\n longitudinalDistanceM: number;\n })\n | (FocusTargetObservationBase & {\n kind:\n \"infinity-environment\";\n })\n | (FocusTargetObservationBase & {\n kind: \"unavailable\";\n reason:\n FocusTargetLossReason;\n });\n\n/**\n * Immutable focus-controller state for MF, AF-S or AF-C.\n *\n * The resolved focus is a finite distance along the optical axis in metres, or infinity.\n * Acquisition, loss, reacquisition and lock records explain why a target can be used. The\n * focus-release check is separate from shutter sequencing. The ideal actuator does not model\n * real AF accuracy or the physical time focusing takes.\n */\nexport interface FocusControlState {\n version:\n typeof FOCUS_CONTROL_STATE_VERSION;\n stateId: string;\n sourceProfile: {\n profileId: string;\n profileVersion: string;\n };\n profileLimitations:\n readonly string[];\n mode:\n FocusControlMode;\n acquisitionState:\n FocusAcquisitionState;\n focus:\n FocusPlane;\n activeTargetId?: string;\n activeFocusAreaId?: string;\n lastEventTimeSeconds: number;\n focusResolvedAtSeconds:\n number;\n locked: boolean;\n lock?: {\n lockedAtSeconds: number;\n resumeAcquisitionState:\n Exclude<\n FocusAcquisitionState,\n \"locked\"\n >;\n };\n actuatorModel:\n \"ideal-instantaneous\";\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\";\n exposureModified: false;\n meteringModified: false;\n whiteBalanceModified: false;\n subjectTrackingRecognitionModeled:\n false;\n rendererCoordinatesConsumed:\n false;\n limitations:\n readonly string[];\n}\n\nexport interface CreateFocusControlStateInput {\n stateId: string;\n profile:\n FocusControlProfile;\n mode:\n FocusControlMode;\n initialFocus:\n FocusPlane;\n initialTimeSeconds?: number;\n}\n\nexport interface SetManualFocusStateInput {\n state:\n FocusControlState;\n stateId: string;\n focus:\n FocusPlane;\n eventTimeSeconds: number;\n commandId?: string;\n}\n\nexport type FocusTargetControlEvent =\n | \"acquire\"\n | \"update\";\n\nexport interface ResolveFocusTargetObservationInput {\n state:\n FocusControlState;\n stateId: string;\n event:\n FocusTargetControlEvent;\n observation:\n FocusTargetObservation;\n}\n\nexport interface FocusTargetResolution {\n state:\n FocusControlState;\n targetObservationApplied:\n boolean;\n focusChanged: boolean;\n acquisitionEvent:\n FocusTargetControlEvent;\n actuatorModel:\n \"ideal-instantaneous\";\n silentRetargetingPerformed:\n false;\n}\n\nexport interface SetFocusLockInput {\n state:\n FocusControlState;\n stateId: string;\n locked: boolean;\n eventTimeSeconds: number;\n}\n\nexport interface AssessFocusReleaseGateInput {\n state:\n FocusControlState;\n profile:\n FocusControlProfile;\n priority:\n FocusReleasePriority;\n}\n\nexport interface FocusReleaseGateAssessment {\n priority:\n FocusReleasePriority;\n releaseAuthorized: boolean;\n reason:\n | \"manual-focus-state\"\n | \"focus-acquired\"\n | \"focus-locked\"\n | \"release-priority-bypasses-focus-gate\"\n | \"focus-not-acquired\"\n | \"balanced-policy-not-modeled\";\n requiresProfileSpecificBalancedPolicy:\n boolean;\n opticalFocusModified: false;\n exposureModified: false;\n}\n\nconst FOCUS_MODES =\n new Set<FocusControlMode>([\n \"manual\",\n \"single-af\",\n \"continuous-af\"\n ]);\n\nconst RELEASE_PRIORITIES =\n new Set<FocusReleasePriority>([\n \"focus-priority\",\n \"release-priority\",\n \"balanced\"\n ]);\n\nconst TARGET_LOSS_REASONS =\n new Set<FocusTargetLossReason>([\n \"occluded\",\n \"out-of-frame\",\n \"identity-lost\",\n \"outside-focus-area\"\n ]);\n\nfunction requireRecord(\n value: unknown,\n path: string,\n allowedKeys: readonly string[] | null\n): UnknownRecord {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value)\n ) {\n throw new InvalidConfigurationError(\n path + \" must be an object.\"\n );\n }\n if (allowedKeys !== null) rejectUnknownFields(value, allowedKeys, path);\n return value as UnknownRecord;\n}\n\nfunction requireNonEmptyString(\n value: unknown,\n path: string\n): string {\n if (\n typeof value !== \"string\" ||\n value.trim().length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty string.\"\n );\n }\n return value.trim();\n}\n\nfunction requireScientificNonEmptyString(\n value: string,\n path: string\n): string {\n if (\n typeof value !== \"string\" ||\n value.trim().length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty string.\"\n );\n }\n return value.trim();\n}\n\nfunction requireScientificNonNegativeFinite(\n value: number,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value < 0\n ) {\n throw new InvalidScientificInputError(\n path +\n \" must be finite and greater than or equal to zero.\"\n );\n }\n return value;\n}\n\nfunction requireScientificPositiveFinite(\n value: number,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value <= 0\n ) {\n throw new InvalidScientificInputError(\n path +\n \" must be finite and greater than zero.\"\n );\n }\n return value;\n}\n\nfunction parseLimitations(\n value: unknown,\n path: string\n): readonly string[] {\n if (!Array.isArray(value)) {\n throw new InvalidConfigurationError(\n path + \" must be an array.\"\n );\n }\n const parsed =\n value.map((entry, index) =>\n requireNonEmptyString(\n entry,\n path +\n \"[\" +\n index +\n \"]\"\n )\n );\n if (\n new Set(parsed).size !==\n parsed.length\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must not contain duplicates.\"\n );\n }\n return parsed;\n}\n\nfunction parseUniqueEnumList<T extends string>(\n value: unknown,\n path: string,\n allowed: ReadonlySet<T>\n): readonly T[] {\n if (\n !Array.isArray(value) ||\n value.length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty array.\"\n );\n }\n const parsed =\n value.map((entry, index) => {\n if (\n typeof entry !==\n \"string\" ||\n !allowed.has(entry as T)\n ) {\n throw new InvalidConfigurationError(\n path +\n \"[\" +\n index +\n \"] is invalid.\"\n );\n }\n return entry as T;\n });\n if (\n new Set(parsed).size !==\n parsed.length\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must not contain duplicates.\"\n );\n }\n return parsed;\n}\n\n/**\n * Validates an untrusted focus-control profile and returns it normalized. Unknown enum values,\n * missing required fields and inconsistent scientific data are rejected.\n *\n * Focus is a distance along the optical axis or infinity, never a distance on screen. The ideal\n * actuator focuses on the target observations it is given. It does not model a real AF sensor, a\n * focus-ring scale or focusing time.\n * @param value - Untrusted data. TypeScript types alone are not validation.\n * @returns The validated profile. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function parseFocusControlProfile(\n value: unknown\n): FocusControlProfile {\n const record =\n requireRecord(\n value,\n \"focusControlProfile\", [\"schemaVersion\", \"scientificStatus\", \"actuator\", \"continuousTargetLossPolicy\", \"profileId\", \"profileVersion\", \"supportedModes\", \"supportedReleasePriorities\", \"evidence\", \"limitations\"]\n );\n\n if (\n record.schemaVersion !==\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.schemaVersion must be \"' +\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION +\n '\".'\n );\n }\n if (\n record.scientificStatus !==\n \"approximation\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.scientificStatus must be \"approximation\".'\n );\n }\n\n const actuator =\n requireRecord(\n record.actuator,\n \"focusControlProfile.actuator\", [\"kind\", \"evidence\"]\n );\n if (\n actuator.kind !==\n \"ideal-instantaneous\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.actuator.kind must be \"ideal-instantaneous\" in schema 0.1.0.'\n );\n }\n if (\n record\n .continuousTargetLossPolicy !==\n \"hold-last-focus-require-explicit-reacquisition\"\n ) {\n throw new InvalidConfigurationError(\n 'focusControlProfile.continuousTargetLossPolicy must be \"hold-last-focus-require-explicit-reacquisition\".'\n );\n }\n\n return {\n schemaVersion:\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION,\n profileId:\n requireNonEmptyString(\n record.profileId,\n \"focusControlProfile.profileId\"\n ),\n profileVersion:\n requireNonEmptyString(\n record.profileVersion,\n \"focusControlProfile.profileVersion\"\n ),\n scientificStatus:\n \"approximation\",\n supportedModes:\n parseUniqueEnumList(\n record.supportedModes,\n \"focusControlProfile.supportedModes\",\n FOCUS_MODES\n ),\n actuator: {\n kind:\n \"ideal-instantaneous\",\n evidence:\n parseEvidenceList(\n actuator.evidence,\n \"focusControlProfile.actuator.evidence\"\n )\n },\n continuousTargetLossPolicy:\n \"hold-last-focus-require-explicit-reacquisition\",\n supportedReleasePriorities:\n parseUniqueEnumList(\n record\n .supportedReleasePriorities,\n \"focusControlProfile.supportedReleasePriorities\",\n RELEASE_PRIORITIES\n ),\n evidence:\n parseEvidenceList(\n record.evidence,\n \"focusControlProfile.evidence\"\n ),\n limitations:\n parseLimitations(\n record.limitations,\n \"focusControlProfile.limitations\"\n )\n };\n}\n\nfunction cloneJson<T>(\n value: T\n): T {\n return JSON.parse(\n JSON.stringify(value)\n ) as T;\n}\n\nfunction deepFreeze<T>(\n value: T\n): T {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.isFrozen(value)\n ) {\n return value;\n }\n\n Object.freeze(value);\n for (\n const child of\n Object.values(\n value as UnknownRecord\n )\n ) {\n deepFreeze(child);\n }\n return value;\n}\n\nfunction immutableState(\n state:\n FocusControlState\n): FocusControlState {\n return deepFreeze(\n cloneJson(state)\n );\n}\n\nfunction stateBase(\n stateId: string,\n profile:\n FocusControlProfile,\n mode:\n FocusControlMode,\n focus:\n FocusPlane,\n acquisitionState:\n FocusAcquisitionState,\n eventTimeSeconds: number,\n focusResolvedAtSeconds:\n number,\n activeTargetId?:\n string,\n activeFocusAreaId?:\n string,\n lock?:\n FocusControlState[\"lock\"]\n): FocusControlState {\n return immutableState({\n version:\n FOCUS_CONTROL_STATE_VERSION,\n stateId:\n requireScientificNonEmptyString(\n stateId,\n \"stateId\"\n ),\n sourceProfile: {\n profileId:\n profile.profileId,\n profileVersion:\n profile.profileVersion\n },\n profileLimitations: [\n ...profile.limitations\n ],\n mode,\n acquisitionState,\n focus:\n parseFocusPlane(focus),\n ...(activeTargetId ===\n undefined\n ? {}\n : {\n activeTargetId\n }),\n ...(activeFocusAreaId ===\n undefined\n ? {}\n : {\n activeFocusAreaId\n }),\n lastEventTimeSeconds:\n eventTimeSeconds,\n focusResolvedAtSeconds,\n locked:\n acquisitionState ===\n \"locked\",\n ...(lock === undefined\n ? {}\n : {\n lock\n }),\n actuatorModel:\n \"ideal-instantaneous\",\n continuousTargetLossPolicy:\n profile\n .continuousTargetLossPolicy,\n exposureModified: false,\n meteringModified: false,\n whiteBalanceModified:\n false,\n subjectTrackingRecognitionModeled:\n false,\n rendererCoordinatesConsumed:\n false,\n limitations: [\n ...profile.limitations,\n \"Focus target observations use longitudinal camera-space/conjugate distance, not renderer ray length.\",\n \"Ideal instantaneous focus actuation is an approximation and does not represent commercial AF speed, error, hunting, recognition, or low-light behavior.\",\n \"Focus control does not modify exposure, metering, white balance, or scene illumination.\"\n ]\n });\n}\n\nfunction requireSupportedMode(\n profile:\n FocusControlProfile,\n mode:\n FocusControlMode\n): void {\n if (\n !profile.supportedModes\n .includes(mode)\n ) {\n throw new InvalidScientificInputError(\n \"Selected focus-control mode is not supported by the profile.\"\n );\n }\n}\n\nfunction requireMonotonicEventTime(\n current:\n FocusControlState,\n eventTimeSeconds: number\n): number {\n const parsed =\n requireScientificNonNegativeFinite(\n eventTimeSeconds,\n \"eventTimeSeconds\"\n );\n if (\n parsed <\n current.lastEventTimeSeconds\n ) {\n throw new InvalidScientificInputError(\n \"Focus-control event time must not move backward.\"\n );\n }\n return parsed;\n}\n\nfunction verifyStateProfile(\n state:\n FocusControlState,\n profile:\n FocusControlProfile\n): void {\n if (\n state.sourceProfile\n .profileId !==\n profile.profileId ||\n state.sourceProfile\n .profileVersion !==\n profile.profileVersion\n ) {\n throw new InvalidScientificInputError(\n \"Focus-control state/profile identity does not match.\"\n );\n }\n}\n\n/**\n * Creates the initial ideal focus-controller state from a profile, a focus plane and a public\n * state ID.\n * @param input - New state ID, profile, focus mode, initial focus plane and optional start time.\n * @returns The initial state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function createFocusControlState(\n input:\n CreateFocusControlStateInput\n): FocusControlState {\n requireInputKeys(input, \"createFocusControlState\", [\"stateId\", \"profile\", \"mode\", \"initialFocus\", \"initialTimeSeconds\"]);\n const profile =\n parseFocusControlProfile(\n input.profile\n );\n requireSupportedMode(\n profile,\n input.mode\n );\n const time =\n input.initialTimeSeconds ===\n undefined\n ? 0\n : requireScientificNonNegativeFinite(\n input.initialTimeSeconds,\n \"initialTimeSeconds\"\n );\n\n return stateBase(\n input.stateId,\n profile,\n input.mode,\n input.initialFocus,\n \"idle\",\n time,\n time\n );\n}\n\nfunction stateProfileView(\n state:\n FocusControlState\n): FocusControlProfile {\n return {\n schemaVersion:\n FOCUS_CONTROL_PROFILE_SCHEMA_VERSION,\n profileId:\n state.sourceProfile\n .profileId,\n profileVersion:\n state.sourceProfile\n .profileVersion,\n scientificStatus:\n \"approximation\",\n supportedModes: [\n state.mode\n ],\n actuator: {\n kind:\n \"ideal-instantaneous\",\n evidence: []\n },\n continuousTargetLossPolicy:\n state\n .continuousTargetLossPolicy,\n supportedReleasePriorities: [\n \"focus-priority\",\n \"release-priority\",\n \"balanced\"\n ],\n evidence: [],\n limitations:\n state.profileLimitations\n };\n}\n\n/**\n * Returns the state after manually focusing on the given finite or infinity plane. No lens\n * actuator or focus-ring conversion is modelled.\n * @param input - Current state, new state ID, new focus plane and event time.\n * @returns The new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function setManualFocusState(\n input:\n SetManualFocusStateInput\n): FocusControlState {\n requireInputKeys(input, \"setManualFocusState\", [\"state\", \"stateId\", \"focus\", \"eventTimeSeconds\", \"commandId\"]);\n requireInputObject(input.state, \"state\");\n if (\n input.state.mode !==\n \"manual\"\n ) {\n throw new InvalidScientificInputError(\n \"setManualFocusState requires manual focus mode.\"\n );\n }\n if (input.state.locked) {\n throw new InvalidScientificInputError(\n \"Manual focus cannot change while focus lock is active.\"\n );\n }\n if (\n input.commandId !==\n undefined\n ) {\n requireScientificNonEmptyString(\n input.commandId,\n \"commandId\"\n );\n }\n const time =\n requireMonotonicEventTime(\n input.state,\n input.eventTimeSeconds\n );\n\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"manual\",\n input.focus,\n \"idle\",\n time,\n time\n );\n}\n\nfunction parseObservation(\n observation:\n FocusTargetObservation\n): FocusTargetObservation {\n const targetId =\n requireScientificNonEmptyString(\n observation.targetId,\n \"observation.targetId\"\n );\n const observedAtSeconds =\n requireScientificNonNegativeFinite(\n observation\n .observedAtSeconds,\n \"observation.observedAtSeconds\"\n );\n const focusAreaId =\n observation.focusAreaId ===\n undefined\n ? undefined\n : requireScientificNonEmptyString(\n observation.focusAreaId,\n \"observation.focusAreaId\"\n );\n\n if (\n observation.kind ===\n \"finite-surface\"\n ) {\n return {\n kind: \"finite-surface\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds,\n longitudinalDistanceM:\n requireScientificPositiveFinite(\n observation\n .longitudinalDistanceM,\n \"observation.longitudinalDistanceM\"\n )\n };\n }\n\n if (\n observation.kind ===\n \"infinity-environment\"\n ) {\n return {\n kind:\n \"infinity-environment\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds\n };\n }\n\n if (\n observation.kind ===\n \"unavailable\" &&\n TARGET_LOSS_REASONS.has(\n observation.reason\n )\n ) {\n return {\n kind: \"unavailable\",\n targetId,\n ...(focusAreaId ===\n undefined\n ? {}\n : {\n focusAreaId\n }),\n observedAtSeconds,\n reason:\n observation.reason\n };\n }\n\n throw new InvalidConfigurationError(\n \"observation.kind/reason is invalid.\"\n );\n}\n\nfunction focusFromObservation(\n observation:\n Exclude<\n FocusTargetObservation,\n {\n kind: \"unavailable\";\n }\n >\n): FocusPlane {\n if (\n observation.kind ===\n \"infinity-environment\"\n ) {\n return {\n kind: \"infinity\"\n };\n }\n return {\n kind: \"finite\",\n distanceM:\n observation\n .longitudinalDistanceM\n };\n}\n\nfunction focusEquals(\n a: FocusPlane,\n b: FocusPlane\n): boolean {\n if (\n a.kind !== b.kind\n ) {\n return false;\n }\n if (\n a.kind === \"infinity\" ||\n b.kind === \"infinity\"\n ) {\n return true;\n }\n return (\n a.distanceM ===\n b.distanceM\n );\n}\n\nfunction stateFromResolvedTarget(\n input:\n ResolveFocusTargetObservationInput,\n observation:\n Exclude<\n FocusTargetObservation,\n {\n kind: \"unavailable\";\n }\n >\n): FocusTargetResolution {\n const focus =\n focusFromObservation(\n observation\n );\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n focus,\n \"acquired\",\n observation\n .observedAtSeconds,\n observation\n .observedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged:\n !focusEquals(\n input.state.focus,\n focus\n ),\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n}\n\nfunction unchangedResolution(\n input:\n ResolveFocusTargetObservationInput\n): FocusTargetResolution {\n return {\n state: input.state,\n targetObservationApplied:\n false,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n}\n\n/**\n * Applies one target observation (target available or lost) under the selected AF-S or AF-C\n * policy, and records whether the target was acquired or reacquired.\n *\n * The ideal actuator focuses on the observation as given. Target loss, reacquisition, focus\n * lock and release priority are separate state changes.\n * @param input - Current state, new state ID, control event and target observation.\n * @returns The resolution and new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function resolveFocusTargetObservation(\n input:\n ResolveFocusTargetObservationInput\n): FocusTargetResolution {\n requireInputKeys(input, \"resolveFocusTargetObservation\", [\"state\", \"stateId\", \"event\", \"observation\"]);\n if (\n input.event !== \"acquire\" &&\n input.event !== \"update\"\n ) {\n throw new InvalidConfigurationError(\n 'Focus target event must be \"acquire\" or \"update\".'\n );\n }\n if (\n input.state.mode ===\n \"manual\"\n ) {\n throw new InvalidScientificInputError(\n \"Manual focus does not automatically consume autofocus target observations.\"\n );\n }\n\n const observation =\n parseObservation(\n input.observation\n );\n requireMonotonicEventTime(\n input.state,\n observation\n .observedAtSeconds\n );\n\n if (input.state.locked) {\n return unchangedResolution(\n input\n );\n }\n\n if (\n input.state.mode ===\n \"single-af\"\n ) {\n if (\n input.event ===\n \"update\" &&\n input.state\n .acquisitionState ===\n \"acquired\"\n ) {\n return unchangedResolution(\n input\n );\n }\n if (\n input.event !==\n \"acquire\"\n ) {\n throw new InvalidScientificInputError(\n \"Single AF requires an explicit acquire event before target updates.\"\n );\n }\n if (\n observation.kind ===\n \"unavailable\"\n ) {\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"single-af\",\n input.state.focus,\n \"target-lost\",\n observation\n .observedAtSeconds,\n input.state\n .focusResolvedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n }\n return stateFromResolvedTarget(\n input,\n observation\n );\n }\n\n if (\n input.event ===\n \"update\"\n ) {\n if (\n input.state\n .activeTargetId ===\n undefined\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF requires an explicit acquire event before updates.\"\n );\n }\n if (\n observation.targetId !==\n input.state\n .activeTargetId\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF update targetId must match the active target; silent retargeting is not permitted.\"\n );\n }\n if (\n input.state\n .acquisitionState ===\n \"target-lost\"\n ) {\n throw new InvalidScientificInputError(\n \"Continuous AF target loss requires an explicit acquire event before reacquisition.\"\n );\n }\n }\n\n if (\n observation.kind ===\n \"unavailable\"\n ) {\n const state =\n stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n \"continuous-af\",\n input.state.focus,\n \"target-lost\",\n observation\n .observedAtSeconds,\n input.state\n .focusResolvedAtSeconds,\n observation.targetId,\n observation.focusAreaId\n );\n return {\n state,\n targetObservationApplied:\n true,\n focusChanged: false,\n acquisitionEvent:\n input.event,\n actuatorModel:\n \"ideal-instantaneous\",\n silentRetargetingPerformed:\n false\n };\n }\n\n return stateFromResolvedTarget(\n input,\n observation\n );\n}\n\n/**\n * Locks or unlocks focus. The physical focus plane does not change.\n * @param input - Current state, new state ID, lock setting and event time.\n * @returns The new state. Success does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function setFocusLock(\n input:\n SetFocusLockInput\n): FocusControlState {\n requireInputKeys(input, \"setFocusLock\", [\"state\", \"stateId\", \"locked\", \"eventTimeSeconds\"]);\n const time =\n requireMonotonicEventTime(\n input.state,\n input.eventTimeSeconds\n );\n\n if (input.locked) {\n if (input.state.locked) {\n return input.state;\n }\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n input.state.focus,\n \"locked\",\n time,\n input.state\n .focusResolvedAtSeconds,\n input.state\n .activeTargetId,\n input.state\n .activeFocusAreaId,\n {\n lockedAtSeconds:\n time,\n resumeAcquisitionState:\n input.state\n .acquisitionState as Exclude<\n FocusAcquisitionState,\n \"locked\"\n >\n }\n );\n }\n\n if (!input.state.locked) {\n return input.state;\n }\n const resume =\n input.state.lock\n ?.resumeAcquisitionState;\n if (resume === undefined) {\n throw new InvalidScientificInputError(\n \"Locked focus state is missing its resume acquisition state.\"\n );\n }\n\n return stateBase(\n input.stateId,\n stateProfileView(\n input.state\n ),\n input.state.mode,\n input.state.focus,\n resume,\n time,\n input.state\n .focusResolvedAtSeconds,\n input.state\n .activeTargetId,\n input.state\n .activeFocusAreaId\n );\n}\n\n/**\n * Reports whether the shutter may be released under the focus-priority or release-priority\n * policy. It does not operate the shutter.\n * @param input - Current state, profile and release priority.\n * @returns The assessment. Read its structured blockers before acting on an authorization.\n *\n * @see docs/API_REFERENCE.md for the package export and its full type definitions.\n */\nexport function assessFocusReleaseGate(\n input:\n AssessFocusReleaseGateInput\n): FocusReleaseGateAssessment {\n requireInputKeys(input, \"assessFocusReleaseGate\", [\"state\", \"profile\", \"priority\"]);\n const profile =\n parseFocusControlProfile(\n input.profile\n );\n verifyStateProfile(\n input.state,\n profile\n );\n\n if (\n !profile\n .supportedReleasePriorities\n .includes(\n input.priority\n )\n ) {\n throw new InvalidScientificInputError(\n \"Selected focus/release priority is not supported by the profile.\"\n );\n }\n\n if (\n input.priority ===\n \"release-priority\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"release-priority-bypasses-focus-gate\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.priority ===\n \"balanced\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized:\n false,\n reason:\n \"balanced-policy-not-modeled\",\n requiresProfileSpecificBalancedPolicy:\n true,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state.mode ===\n \"manual\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"manual-focus-state\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state\n .acquisitionState ===\n \"locked\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"focus-locked\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n if (\n input.state\n .acquisitionState ===\n \"acquired\"\n ) {\n return {\n priority:\n input.priority,\n releaseAuthorized: true,\n reason:\n \"focus-acquired\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n }\n\n return {\n priority:\n input.priority,\n releaseAuthorized: false,\n reason:\n \"focus-not-acquired\",\n requiresProfileSpecificBalancedPolicy:\n false,\n opticalFocusModified:\n false,\n exposureModified:\n false\n };\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Internal: decides how often native tile loops yield to the host (browser) event loop.
3
+ *
4
+ * Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`
5
+ * callback is awaited only once the work since the last yield reaches a time budget, and always
6
+ * after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA
7
+ * (colour filter array) and noise-seed indexing, and every output value are unaffected.
8
+ * Not exported from the package.
9
+ */
10
+ /** Default work budget between host yields: about half of a 60 Hz frame. */
11
+ export declare const HOST_YIELD_BUDGET_MILLISECONDS = 8;
12
+ export interface HostYieldCadence {
13
+ /** Yield once at least this many milliseconds (monotonic clock) have passed since the last yield. 0 yields after every tile. */
14
+ readonly budgetMilliseconds: number;
15
+ /** Monotonic clock in milliseconds. */
16
+ readonly now: () => number;
17
+ }
18
+ export declare const DEFAULT_HOST_YIELD_CADENCE: HostYieldCadence;
19
+ export interface HostYieldGate {
20
+ /** Restarts the budget, for example at the start of a run and after each host yield finishes. */
21
+ restart(): void;
22
+ /** True once the budget since the last restart is spent. */
23
+ due(): boolean;
24
+ }
25
+ export declare function createHostYieldGate(cadence?: HostYieldCadence): HostYieldGate;
@@ -0,0 +1,25 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * Internal: decides how often native tile loops yield to the host (browser) event loop.
4
+ *
5
+ * Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`
6
+ * callback is awaited only once the work since the last yield reaches a time budget, and always
7
+ * after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA
8
+ * (colour filter array) and noise-seed indexing, and every output value are unaffected.
9
+ * Not exported from the package.
10
+ */
11
+ /** Default work budget between host yields: about half of a 60 Hz frame. */
12
+ export const HOST_YIELD_BUDGET_MILLISECONDS = 8;
13
+ export const DEFAULT_HOST_YIELD_CADENCE = Object.freeze({
14
+ budgetMilliseconds: HOST_YIELD_BUDGET_MILLISECONDS,
15
+ now: () => performance.now()
16
+ });
17
+ export function createHostYieldGate(cadence = DEFAULT_HOST_YIELD_CADENCE) {
18
+ const { budgetMilliseconds, now } = cadence;
19
+ let since = now();
20
+ return {
21
+ restart() { since = now(); },
22
+ due() { return budgetMilliseconds <= 0 || now() - since >= budgetMilliseconds; }
23
+ };
24
+ }
25
+ //# sourceMappingURL=host-yield-cadence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-yield-cadence.js","sourceRoot":"","sources":["../../src/capture/host-yield-cadence.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAShD,MAAM,CAAC,MAAM,0BAA0B,GAAqB,MAAM,CAAC,MAAM,CAAC;IACxE,kBAAkB,EAAE,8BAA8B;IAClD,GAAG,EAAE,GAAW,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE;CACrC,CAAC,CAAC;AASH,MAAM,UAAU,mBAAmB,CAAC,UAA4B,0BAA0B;IACxF,MAAM,EAAC,kBAAkB,EAAE,GAAG,EAAC,GAAG,OAAO,CAAC;IAC1C,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;IAClB,OAAO;QACL,OAAO,KAAW,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;QAClC,GAAG,KAAc,OAAO,kBAAkB,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,KAAK,IAAI,kBAAkB,CAAC,CAAC,CAAC;KAC1F,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Internal: decides how often native tile loops yield to the host (browser) event loop.\n *\n * Tiles stay small, for bounded memory and exact tile identity. But the host's `yieldControl`\n * callback is awaited only once the work since the last yield reaches a time budget, and always\n * after the final tile. This only changes when the host gets to run. Tile requests, absolute CFA\n * (colour filter array) and noise-seed indexing, and every output value are unaffected.\n * Not exported from the package.\n */\n\n/** Default work budget between host yields: about half of a 60 Hz frame. */\nexport const HOST_YIELD_BUDGET_MILLISECONDS = 8;\n\nexport interface HostYieldCadence {\n /** Yield once at least this many milliseconds (monotonic clock) have passed since the last yield. 0 yields after every tile. */\n readonly budgetMilliseconds: number;\n /** Monotonic clock in milliseconds. */\n readonly now: () => number;\n}\n\nexport const DEFAULT_HOST_YIELD_CADENCE: HostYieldCadence = Object.freeze({\n budgetMilliseconds: HOST_YIELD_BUDGET_MILLISECONDS,\n now: (): number => performance.now()\n});\n\nexport interface HostYieldGate {\n /** Restarts the budget, for example at the start of a run and after each host yield finishes. */\n restart(): void;\n /** True once the budget since the last restart is spent. */\n due(): boolean;\n}\n\nexport function createHostYieldGate(cadence: HostYieldCadence = DEFAULT_HOST_YIELD_CADENCE): HostYieldGate {\n const {budgetMilliseconds, now} = cadence;\n let since = now();\n return {\n restart(): void { since = now(); },\n due(): boolean { return budgetMilliseconds <= 0 || now() - since >= budgetMilliseconds; }\n };\n}\n"]}
@@ -1,12 +1,14 @@
1
1
  import { type CalculationResult } from "../core/calculation-result.js";
2
2
  import { type SimulatedCapture, type CaptureLinearPlane, type CaptureLinearImageState } from "./simulated-capture.js";
3
3
  export declare const LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION: "0.1.0";
4
- /** Uniform channel mapping; capture reference white comes from the source plane. */
4
+ /** Version of the `uniform-linear-capture-uint16` model. 0.2.0 made rounding exact: nearest, ties up (Math.round). */
5
+ export declare const LINEAR_CAPTURE_ENCODING_MODEL_VERSION: "0.2.0";
6
+ /** The same linear mapping for every channel. The reference white value comes from the source plane. */
5
7
  export interface LinearCaptureEncoding {
6
8
  schemaVersion: typeof LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION;
7
9
  /** Relative source sample value assigned blackCode; may be negative. */
8
10
  blackValue: number;
9
- /** Integer code at blackValue, 0..65534. An offset can preserve negative samples. */
11
+ /** Integer code for blackValue, 0..65534. A nonzero offset can keep negative samples. */
10
12
  blackCode: number;
11
13
  /** Code at the plane's referenceWhiteValue, strictly above blackCode, at most 65535. */
12
14
  referenceWhiteCode: number;
@@ -14,20 +16,20 @@ export interface LinearCaptureEncoding {
14
16
  outOfRange: "clip" | "reject";
15
17
  rounding: "nearest-ties-up";
16
18
  }
17
- /** Strict allowlisted encoding parser; no default clipping/rounding policy is invented. */
19
+ /** Strictly parses an encoding profile. It never fills in a default clipping or rounding policy. */
18
20
  export declare function parseLinearCaptureEncoding(value: unknown): LinearCaptureEncoding;
19
21
  export interface LinearCaptureEncodingInput {
20
22
  capture: SimulatedCapture;
21
23
  planeId: string;
22
- /** Prevents substituting a differently interpreted linear plane. */
24
+ /** Identifies the exact source plane, so a plane with a different meaning cannot be swapped in. */
23
25
  requiredImageState: CaptureLinearImageState;
24
26
  encoding: LinearCaptureEncoding;
25
27
  }
26
- /** Format-neutral 16-bit unsigned codes; metadata retains color/WB/saturation meaning. */
28
+ /** 16-bit unsigned codes, not tied to a file format. The metadata keeps their colour, white-balance (WB) and saturation meaning. */
27
29
  export interface EncodedLinearCapture {
28
30
  schemaVersion: typeof LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION;
29
31
  captureId: string;
30
- /** Sanitized geometry/settings/WB/adopted-white/model provenance without float planes. */
32
+ /** Cleaned-up copy of the capture's geometry, settings, WB, adopted white and model provenance, without the float planes. */
31
33
  captureMetadata: Omit<SimulatedCapture, "planes">;
32
34
  sourcePlane: Omit<CaptureLinearPlane, "storage">;
33
35
  encoding: LinearCaptureEncoding;
@@ -40,20 +42,20 @@ export interface EncodedLinearCapture {
40
42
  scale: number;
41
43
  minimumRepresentableValue: number;
42
44
  maximumRepresentableValue: number;
43
- /** Maximum above-black value / reference-white above-black value. */
45
+ /** Headroom: (maximum value − black) / (reference white − black). */
44
46
  headroomFactor: number;
45
- /** 0.5/scale for in-range samples; excludes clipping error. */
47
+ /** Largest rounding error for in-range samples, 0.5/scale. Clipping error is not included. */
46
48
  maximumRoundingError: number;
47
49
  clippedLowSampleCount: number;
48
50
  clippedHighSampleCount: number;
49
- /** No default rendering exposure/display white is chosen by linear encoding. */
51
+ /** Linear encoding never picks a default rendering exposure or display white. */
50
52
  defaultRenderingExposureEv: null;
51
53
  samples: readonly number[];
52
54
  }
53
55
  /**
54
- * Quantizes one immutable inline float plane without changing its capture data.
56
+ * Converts one inline float plane to integer codes. The capture data is not changed.
57
+ *
55
58
  * Mapping: blackCode + (sample-blackValue)/(referenceWhiteValue-blackValue)
56
- * * (referenceWhiteCode-blackCode). Clips only under explicit policy, then rounds.
59
+ * * (referenceWhiteCode-blackCode). It clips only when the policy says so, then rounds.
57
60
  */
58
61
  export declare function calculateLinearCaptureEncoding(input: LinearCaptureEncodingInput): CalculationResult<EncodedLinearCapture>;
59
- //# sourceMappingURL=linear-encoding.d.ts.map
@@ -1,10 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  /**
3
- * Module boundary and integration notes.
4
- * Strict allowlisted encoding parser; no default clipping/rounding policy is invented.
5
- * Quantizes one immutable inline float plane without changing its capture data. Mapping: blackCode +
6
- * (sample-blackValue)/(referenceWhiteValue-blackValue) * (referenceWhiteCode-blackCode). Clips only
7
- * under explicit policy, then rounds.
3
+ * Linear capture encoding: converts a floating-point capture plane to 16-bit unsigned integer
4
+ * codes with a uniform linear mapping. The capture itself is not changed.
8
5
  * @see docs/LINEAR_CAPTURE_ENCODING.md for equations, coordinate/unit conventions, blockers and
9
6
  * support limits.
10
7
  */
@@ -13,10 +10,12 @@ import { calculatedResult } from "../core/calculation-result.js";
13
10
  import { InvalidConfigurationError } from "../core/configuration-error.js";
14
11
  import { parseSimulatedCapture } from "./simulated-capture.js";
15
12
  export const LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION = "0.1.0";
13
+ /** Version of the `uniform-linear-capture-uint16` model. 0.2.0 made rounding exact: nearest, ties up (Math.round). */
14
+ export const LINEAR_CAPTURE_ENCODING_MODEL_VERSION = "0.2.0";
16
15
  function record(value, keys) {
17
16
  return requireAllowlistedRecord(value, keys, "Invalid linear encoding fields.");
18
17
  }
19
- /** Strict allowlisted encoding parser; no default clipping/rounding policy is invented. */
18
+ /** Strictly parses an encoding profile. It never fills in a default clipping or rounding policy. */
20
19
  export function parseLinearCaptureEncoding(value) {
21
20
  const r = record(value, ["schemaVersion", "blackValue", "blackCode", "referenceWhiteCode", "negativeValues", "outOfRange", "rounding"]);
22
21
  if (r.schemaVersion !== LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION || typeof r.blackValue !== "number" || !Number.isFinite(r.blackValue) ||
@@ -31,9 +30,10 @@ export function parseLinearCaptureEncoding(value) {
31
30
  outOfRange: r.outOfRange, rounding: r.rounding };
32
31
  }
33
32
  /**
34
- * Quantizes one immutable inline float plane without changing its capture data.
33
+ * Converts one inline float plane to integer codes. The capture data is not changed.
34
+ *
35
35
  * Mapping: blackCode + (sample-blackValue)/(referenceWhiteValue-blackValue)
36
- * * (referenceWhiteCode-blackCode). Clips only under explicit policy, then rounds.
36
+ * * (referenceWhiteCode-blackCode). It clips only when the policy says so, then rounds.
37
37
  */
38
38
  export function calculateLinearCaptureEncoding(input) {
39
39
  const r = record(input, ["capture", "planeId", "requiredImageState", "encoding"]);
@@ -60,7 +60,7 @@ export function calculateLinearCaptureEncoding(input) {
60
60
  const samples = plane.storage.samples.map((sample) => {
61
61
  if (encoding.negativeValues === "reject" && sample < 0)
62
62
  throw new InvalidConfigurationError("Negative source values are rejected by encoding policy.");
63
- // Compare in the source domain first: finite extremes can clip without overflowing arithmetic.
63
+ // Compare against the limits in source units first, so a huge finite value can clip without overflowing.
64
64
  if (sample < minimum || sample > maximum) {
65
65
  if (encoding.outOfRange === "reject")
66
66
  throw new InvalidConfigurationError("Source value exceeds the encoded range.");
@@ -80,18 +80,19 @@ export function calculateLinearCaptureEncoding(input) {
80
80
  if (sample === plane.referenceWhiteValue)
81
81
  return encoding.referenceWhiteCode;
82
82
  const mapped = encoding.blackCode + (sample - encoding.blackValue) / width * codeWidth;
83
- // Round nearest, exact binary64 ties toward the larger code. Clamp roundoff at endpoints only.
84
- return Math.max(0, Math.min(65535, Math.floor(mapped + .5)));
83
+ // Round to nearest; exact ties go to the larger code (Math.round; Math.floor(x+.5) wrongly rounds
84
+ // 0.49999999999999994 up). Clamp only rounding error at the end points; Math.max(0, -0) is +0.
85
+ return Math.max(0, Math.min(65535, Math.round(mapped)));
85
86
  });
86
87
  const { storage: _storage, ...sourcePlane } = plane;
87
88
  const { planes: _planes, ...captureMetadata } = capture;
88
89
  void _storage;
89
- void _planes; // Float sample arrays are intentionally omitted from encoded metadata.
90
+ void _planes; // The float sample arrays are deliberately left out of the encoded metadata.
90
91
  return calculatedResult({ schemaVersion: LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION, captureId: capture.captureId, captureMetadata, sourcePlane,
91
92
  encoding, sampleLayout: "row-major-interleaved", bitDepth: 16, codeMinimum: 0, codeMaximum: 65535,
92
93
  referenceWhiteValue: plane.referenceWhiteValue, scale, minimumRepresentableValue: minimum, maximumRepresentableValue: maximum,
93
94
  headroomFactor: (65535 - encoding.blackCode) / codeWidth, maximumRoundingError: .5 / scale,
94
- clippedLowSampleCount: low, clippedHighSampleCount: high, defaultRenderingExposureEv: null, samples }, "uniform-linear-capture-uint16", LINEAR_CAPTURE_ENCODING_SCHEMA_VERSION, ["Deterministic unsigned linear codes; no dithering, transfer curve, tone mapping or serializer tags",
95
+ clippedLowSampleCount: low, clippedHighSampleCount: high, defaultRenderingExposureEv: null, samples }, "uniform-linear-capture-uint16", LINEAR_CAPTURE_ENCODING_MODEL_VERSION, ["Deterministic unsigned linear codes; no dithering, transfer curve, tone mapping or serializer tags",
95
96
  "Reference white, capture saturation history, integer maximum and display white remain separate",
96
97
  "In-range error bound covers ideal rounding only; binary64 arithmetic can add floating-point error"]);
97
98
  }