@photivra/engine 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -1
- package/CITATION.cff +1 -1
- package/README.md +6 -6
- package/SECURITY.md +1 -1
- package/dist/capture/native-environment-lean.d.ts +35 -5
- package/dist/capture/native-environment-lean.js +175 -16
- package/dist/capture/native-environment-lean.js.map +1 -1
- package/dist/capture/native-environment-raw.d.ts +9 -1
- package/dist/capture/native-environment-raw.js +14 -9
- package/dist/capture/native-environment-raw.js.map +1 -1
- package/dist/capture/native-environment-tabulated.d.ts +58 -0
- package/dist/capture/native-environment-tabulated.js +91 -0
- package/dist/capture/native-environment-tabulated.js.map +1 -0
- package/dist/core/internal-radiance-evaluator.d.ts +28 -0
- package/dist/core/internal-radiance-evaluator.js +30 -0
- package/dist/core/internal-radiance-evaluator.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/facade/chart-radiance-batch.js +3 -2
- package/dist/facade/chart-radiance-batch.js.map +1 -1
- package/dist/facade/chart-scenes.d.ts +2 -0
- package/dist/facade/chart-scenes.js +4 -3
- package/dist/facade/chart-scenes.js.map +1 -1
- package/dist/facade/diffraction-provider.js +30 -2
- package/dist/facade/diffraction-provider.js.map +1 -1
- package/dist/facade/display-view.d.ts +14 -78
- package/dist/facade/display-view.js +322 -755
- package/dist/facade/display-view.js.map +1 -1
- package/dist/facade/expected-signal-setup.d.ts +65 -0
- package/dist/facade/expected-signal-setup.js +56 -0
- package/dist/facade/expected-signal-setup.js.map +1 -0
- package/dist/facade/expected-signal.d.ts +83 -0
- package/dist/facade/expected-signal.js +571 -0
- package/dist/facade/expected-signal.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +44 -5
- package/dist/facade/scene-radiance.js +107 -30
- package/dist/facade/scene-radiance.js.map +1 -1
- package/dist/facade/simulate-capture.d.ts +14 -6
- package/dist/facade/simulate-capture.js +84 -23
- package/dist/facade/simulate-capture.js.map +1 -1
- package/dist/facade/simulate-display-view.d.ts +24 -0
- package/dist/facade/simulate-display-view.js +117 -94
- package/dist/facade/simulate-display-view.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/docs/API_REFERENCE.md +7 -1
- package/docs/QUICK_START.md +49 -1
- package/docs/api/core-version.md +1 -1
- package/docs/api/exports.json +32 -2
- package/docs/api/facade-scene-radiance.md +34 -1
- package/docs/api/facade-simulate-capture.md +1 -1
- package/docs/api/facade-simulate-display-view.md +39 -0
- package/package.json +1 -1
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
The package and root API versions are recorded once in [Navigation](../API_REFERENCE.md) · [Developer guide](https://github.com/Photivra/photivra/blob/main/docs/DEVELOPERS.md). Generated signatures retain independent schema/model versions. Only the exports listed here are root-package contracts; module-local helpers are not supported deep imports.
|
|
4
4
|
|
|
5
|
+
## CALLER_MATERIAL_SCENE_MAX_MATERIALS
|
|
6
|
+
|
|
7
|
+
Most materials a {@link CallerMaterialScene} may list.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
CALLER_MATERIAL_SCENE_MAX_MATERIALS = 65_536
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## CallerMaterialScene
|
|
14
|
+
|
|
15
|
+
2.7 (#386): a piecewise-constant caller scene, lit by the facade illuminant like a reflectance function. `materials` are
|
|
16
|
+
reflectances as a chart's patches take them (a neutral number in [0, 1] or a reflectance spectrum covering 380–780 nm, at
|
|
17
|
+
most {@link CALLER_MATERIAL_SCENE_MAX_MATERIALS}); `materialAt` returns the index of the material at a plane point (an
|
|
18
|
+
integer from 0 to materials.length − 1). The radiance at a point is that material's, exactly as for a reflectance function
|
|
19
|
+
returning its reflectance, but renderers can tabulate each material once: the display view then takes the chart path.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
export interface CallerMaterialScene {
|
|
23
|
+
kind: "material-function";
|
|
24
|
+
sceneId: string;
|
|
25
|
+
materials: readonly ChartReflectance[];
|
|
26
|
+
materialAt(point: Readonly<SceneMaterialPoint>): number;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
5
30
|
## CallerRadianceScene
|
|
6
31
|
|
|
7
32
|
Caller absolute spectral radiance in W·m⁻²·sr⁻¹·nm⁻¹; the facade illuminant is not used.
|
|
@@ -65,7 +90,7 @@ provider `providerProfileId`.
|
|
|
65
90
|
|
|
66
91
|
```ts
|
|
67
92
|
export function createPlanarSceneRadianceProvider(input: {
|
|
68
|
-
scene: ChartScene | CallerReflectanceScene | CallerRadianceScene;
|
|
93
|
+
scene: ChartScene | CallerReflectanceScene | CallerRadianceScene | CallerMaterialScene;
|
|
69
94
|
illuminant: CaptureIlluminant;
|
|
70
95
|
illuminanceLux: number;
|
|
71
96
|
distanceM: number;
|
|
@@ -140,6 +165,14 @@ export interface ResolvedCaptureIlluminant {
|
|
|
140
165
|
}
|
|
141
166
|
```
|
|
142
167
|
|
|
168
|
+
## SceneMaterialPoint
|
|
169
|
+
|
|
170
|
+
2.7: a scene-plane point without a wavelength, passed to a material scene's `materialAt`.
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
export type SceneMaterialPoint = Omit<ScenePlanePoint, "wavelengthNanometers">;
|
|
174
|
+
```
|
|
175
|
+
|
|
143
176
|
## ScenePlanePoint
|
|
144
177
|
|
|
145
178
|
A point of the scene plane passed to caller scene functions.
|
|
@@ -264,7 +264,7 @@ export interface SimulateCaptureOptions {
|
|
|
264
264
|
compensationStops?: number;
|
|
265
265
|
};
|
|
266
266
|
/** Required: an engine chart (for example `{ preset: "uniform" }`, an 18 % grey card) or a caller reflectance/radiance function. */
|
|
267
|
-
scene: ChartScene | CallerReflectanceScene | CallerRadianceScene;
|
|
267
|
+
scene: ChartScene | CallerReflectanceScene | CallerRadianceScene | CallerMaterialScene;
|
|
268
268
|
/** Distance from the camera to the scene plane in metres. Default 5. */
|
|
269
269
|
subjectDistanceM?: number;
|
|
270
270
|
/**
|
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
The package and root API versions are recorded once in [Navigation](../API_REFERENCE.md) · [Developer guide](https://github.com/Photivra/photivra/blob/main/docs/DEVELOPERS.md). Generated signatures retain independent schema/model versions. Only the exports listed here are root-package contracts; module-local helpers are not supported deep imports.
|
|
4
4
|
|
|
5
|
+
## PreparedDisplayView
|
|
6
|
+
|
|
7
|
+
2.7: a display-view request resolved once (`prepareDisplayView`). `render(view)` gives the same result as
|
|
8
|
+
`simulateDisplayView(options, view)` for the prepared options, byte for byte (samples, view, exposure, scene, diagnostics
|
|
9
|
+
and assumptions; only `diagnostics.timingsMs` differ, and they cover the render only), without repeating the request's
|
|
10
|
+
setup: use it to render one view in many regions, for example on each worker of a progressive display.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
export interface PreparedDisplayView {
|
|
14
|
+
/** Renders a view of the prepared request. Renders may run concurrently; they share no state except read-only setup. */
|
|
15
|
+
render(view: SimulateDisplayViewOptions, renderOptions?: PreparedDisplayViewRenderOptions): Promise<DisplayViewResult>;
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## PreparedDisplayViewRenderOptions
|
|
20
|
+
|
|
21
|
+
Options of one {@link PreparedDisplayView} render.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
export interface PreparedDisplayViewRenderOptions {
|
|
25
|
+
/** Aborting cancels this render only; the promise rejects with a domain error. The request's own `signal` applies to preparing only. */
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## prepareDisplayView
|
|
31
|
+
|
|
32
|
+
2.7 (#387): resolves a {@link simulateDisplayView} request once, without a view, and returns a handle whose `render(view)`
|
|
33
|
+
renders its views. The setup it does once (request validation, the camera, lens, scene, chart and illuminant, the channel
|
|
34
|
+
responses through the environment chain, the diffraction kernels, readout moments, demosaic tables and colour matrix) costs
|
|
35
|
+
about 0.3–1.3 s per call on a 24 MP request; a region costs only its own pixels. Errors in the request are raised here;
|
|
36
|
+
errors in the view by `render`.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
export async function prepareDisplayView(options: SimulateCaptureOptions): Promise<PreparedDisplayView>;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This call is asynchronous; byte hashing uses the caller runtime's Web Crypto.
|
|
43
|
+
|
|
5
44
|
## simulateDisplayView
|
|
6
45
|
|
|
7
46
|
The display view of a capture request: the image the real full-resolution capture (`simulateCapture(options)`) would
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photivra/engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Scientific TypeScript engine for camera optics, exposure, focus, motion, sensor sampling, diffraction, and digital imaging calculations.",
|
|
6
6
|
"type": "module",
|