@photivra/engine 2.2.0 → 2.3.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 +25 -1
- package/CITATION.cff +1 -1
- package/README.md +6 -6
- package/SECURITY.md +1 -1
- package/dist/capture/native-environment-raw.d.ts +18 -0
- package/dist/capture/native-environment-raw.js +17 -1
- package/dist/capture/native-environment-raw.js.map +1 -1
- package/dist/capture/native-raw.d.ts +3 -0
- package/dist/capture/native-raw.js +8 -5
- package/dist/capture/native-raw.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/equipment/generic-prime-lenses.d.ts +46 -0
- package/dist/equipment/generic-prime-lenses.js +59 -0
- package/dist/equipment/generic-prime-lenses.js.map +1 -0
- package/dist/facade/chart-scenes.d.ts +270 -1
- package/dist/facade/chart-scenes.js +443 -17
- package/dist/facade/chart-scenes.js.map +1 -1
- package/dist/facade/scene-radiance.d.ts +47 -0
- package/dist/facade/scene-radiance.js +65 -5
- package/dist/facade/scene-radiance.js.map +1 -1
- package/dist/facade/simulate-capture.d.ts +152 -5
- package/dist/facade/simulate-capture.js +302 -57
- package/dist/facade/simulate-capture.js.map +1 -1
- package/dist/facade/subject-framing.d.ts +55 -0
- package/dist/facade/subject-framing.js +66 -0
- package/dist/facade/subject-framing.js.map +1 -0
- package/dist/gpu/chart-radiance-gpu.d.ts +8 -0
- package/dist/gpu/chart-radiance-gpu.js +20 -1
- package/dist/gpu/chart-radiance-gpu.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/optics/lens-psf-kernels.d.ts +3 -1
- package/dist/optics/lens-psf-kernels.js +7 -2
- package/dist/optics/lens-psf-kernels.js.map +1 -1
- package/docs/API_REFERENCE.md +48 -1
- package/docs/QUICK_START.md +269 -4
- package/docs/api/core-version.md +1 -1
- package/docs/api/equipment-generic-prime-lenses.md +85 -0
- package/docs/api/exports.json +167 -2
- package/docs/api/facade-chart-scenes.md +280 -4
- package/docs/api/facade-scene-radiance.md +42 -0
- package/docs/api/facade-simulate-capture.md +108 -3
- package/docs/api/facade-subject-framing.md +72 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# facade/subject-framing.ts public contracts
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## calculateSubjectDistanceForFraming
|
|
6
|
+
|
|
7
|
+
The subject distance that fits a chart of a given physical size to the frame, with magnification, coverage and the minimum-focus check (2.3).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
export function calculateSubjectDistanceForFraming(input: CalculateSubjectDistanceForFramingInput): SubjectFraming;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
14
|
+
|
|
15
|
+
## CalculateSubjectDistanceForFramingInput
|
|
16
|
+
|
|
17
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export interface CalculateSubjectDistanceForFramingInput {
|
|
21
|
+
/** Active sensor (or simulated frame) size, mm. */
|
|
22
|
+
sensor: { widthMm: number; heightMm: number };
|
|
23
|
+
/** Physical focal length, mm. Give exactly one of this and `equivalentFocalLengthMm`. */
|
|
24
|
+
focalLengthMm?: number;
|
|
25
|
+
/** Full-frame-equivalent focal length (diagonal crop factor); a generic prime's value also reports that lens. */
|
|
26
|
+
equivalentFocalLengthMm?: number;
|
|
27
|
+
/** Chart size as for `simulateCapture` `chartSize`: heightM defaults to widthM × the sensor aspect (height / width). */
|
|
28
|
+
chart: { widthM: number; heightM?: number };
|
|
29
|
+
fit?: SubjectFramingFit;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## SubjectFraming
|
|
34
|
+
|
|
35
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
export interface SubjectFraming {
|
|
39
|
+
/** Distance from the lens to the chart plane, metres: f·(1 + 1/m). */
|
|
40
|
+
subjectDistanceM: number;
|
|
41
|
+
/** Image size ÷ object size, f/(d − f). */
|
|
42
|
+
magnification: number;
|
|
43
|
+
/** Thin-lens image distance f·(1 + m), mm. */
|
|
44
|
+
imageDistanceMm: number;
|
|
45
|
+
focalLengthMm: number;
|
|
46
|
+
equivalentFocalLengthMm: number;
|
|
47
|
+
cropFactor35Mm: number;
|
|
48
|
+
chart: { widthM: number; heightM: number };
|
|
49
|
+
fit: SubjectFramingFit;
|
|
50
|
+
/** Plane area the frame covers at that distance, metres. */
|
|
51
|
+
framedWidthM: number;
|
|
52
|
+
framedHeightM: number;
|
|
53
|
+
/** Fraction of the frame width and height the chart covers (1 on the fitted side; above 1 means cropped). */
|
|
54
|
+
coverage: { frameWidthFraction: number; frameHeightFraction: number };
|
|
55
|
+
/** The generic prime of this equivalent focal length, when there is one. */
|
|
56
|
+
prime: GenericPrimeLens | null;
|
|
57
|
+
/** The generic prime rule max(0.10 m, f·(1 + 1/0.15)) at this focal length (the prime's own value when there is one). */
|
|
58
|
+
minimumFocusDistanceM: number;
|
|
59
|
+
/** True when the fit distance is closer than the minimum focus distance: the chart cannot be framed this way. */
|
|
60
|
+
belowMinimumFocus: boolean;
|
|
61
|
+
scientificStatus: "approximation";
|
|
62
|
+
assumptions: readonly SimulateCaptureAssumption[];
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## SubjectFramingFit
|
|
67
|
+
|
|
68
|
+
How the chart fits the frame: `contain` (default; the whole chart is visible and its limiting side touches the frame), `width`, `height` or `cover` (the chart fills the frame and is cropped on its other side).
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
export type SubjectFramingFit = "contain" | "width" | "height" | "cover";
|
|
72
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photivra/engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.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",
|