@photivra/engine 2.21.0 → 2.23.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 +150 -1
- package/CITATION.cff +1 -1
- package/README.md +6 -6
- package/SECURITY.md +1 -1
- package/THIRD_PARTY.md +11 -0
- package/dist/capture/c2pa-embed.d.ts +116 -0
- package/dist/capture/c2pa-embed.js +493 -0
- package/dist/capture/c2pa-embed.js.map +1 -0
- package/dist/capture/dng-import.d.ts +73 -8
- package/dist/capture/dng-import.js +315 -80
- package/dist/capture/dng-import.js.map +1 -1
- package/dist/capture/dng-opcodes.d.ts +96 -0
- package/dist/capture/dng-opcodes.js +391 -0
- package/dist/capture/dng-opcodes.js.map +1 -0
- package/dist/capture/dng-profile-maps.d.ts +99 -0
- package/dist/capture/dng-profile-maps.js +381 -0
- package/dist/capture/dng-profile-maps.js.map +1 -0
- package/dist/capture/dng-stage-image.d.ts +23 -0
- package/dist/capture/dng-stage-image.js +65 -0
- package/dist/capture/dng-stage-image.js.map +1 -0
- package/dist/capture/jpeg-xl-tiles.d.ts +22 -0
- package/dist/capture/jpeg-xl-tiles.js +151 -0
- package/dist/capture/jpeg-xl-tiles.js.map +1 -0
- package/dist/capture/lossy-jpeg.d.ts +17 -0
- package/dist/capture/lossy-jpeg.js +369 -0
- package/dist/capture/lossy-jpeg.js.map +1 -0
- package/dist/capture/native-raw-development.d.ts +2 -1
- package/dist/capture/native-raw-development.js.map +1 -1
- package/dist/color/neighbor-highlight-reconstruction.d.ts +76 -0
- package/dist/color/neighbor-highlight-reconstruction.js +257 -0
- package/dist/color/neighbor-highlight-reconstruction.js.map +1 -0
- package/dist/color/sensor-color-development.d.ts +5 -0
- package/dist/color/sensor-color-development.js +7 -1
- package/dist/color/sensor-color-development.js.map +1 -1
- package/dist/color/spectral-spikiness.d.ts +11 -0
- package/dist/color/spectral-spikiness.js +23 -0
- package/dist/color/spectral-spikiness.js.map +1 -0
- package/dist/core/execution-error.d.ts +21 -0
- package/dist/core/execution-error.js +12 -0
- package/dist/core/execution-error.js.map +1 -0
- 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/catalogue-lens-signal.d.ts +26 -1
- package/dist/facade/catalogue-lens-signal.js +25 -7
- package/dist/facade/catalogue-lens-signal.js.map +1 -1
- package/dist/facade/diffraction-provider.d.ts +1 -1
- package/dist/facade/diffraction-provider.js +4 -4
- package/dist/facade/diffraction-provider.js.map +1 -1
- package/dist/facade/display-view-gpu-session.js +38 -6
- package/dist/facade/display-view-gpu-session.js.map +1 -1
- package/dist/facade/display-view-gpu.d.ts +13 -5
- package/dist/facade/display-view-gpu.js.map +1 -1
- package/dist/facade/display-view-normal.d.ts +15 -0
- package/dist/facade/display-view-normal.js +44 -0
- package/dist/facade/display-view-normal.js.map +1 -0
- package/dist/facade/display-view-rendering.d.ts +102 -0
- package/dist/facade/display-view-rendering.js +633 -0
- package/dist/facade/display-view-rendering.js.map +1 -0
- package/dist/facade/display-view.d.ts +37 -65
- package/dist/facade/display-view.js +147 -476
- package/dist/facade/display-view.js.map +1 -1
- package/dist/facade/expected-signal-setup.js +2 -2
- package/dist/facade/expected-signal-setup.js.map +1 -1
- package/dist/facade/fast-methods.d.ts +1 -1
- package/dist/facade/fast-methods.js +37 -8
- package/dist/facade/fast-methods.js.map +1 -1
- package/dist/facade/generic-lens-capture.d.ts +1 -1
- package/dist/facade/generic-lens-capture.js +1 -1
- package/dist/facade/generic-lens-capture.js.map +1 -1
- package/dist/facade/image-plane.js +41 -10
- package/dist/facade/image-plane.js.map +1 -1
- package/dist/facade/on-demand-kits.d.ts +14 -0
- package/dist/facade/on-demand-kits.js +36 -0
- package/dist/facade/on-demand-kits.js.map +1 -0
- package/dist/facade/opt-in-kit.d.ts +9 -0
- package/dist/facade/opt-in-kit.js +11 -0
- package/dist/facade/opt-in-kit.js.map +1 -0
- package/dist/facade/quality-kit.d.ts +21 -0
- package/dist/facade/quality-kit.js +23 -0
- package/dist/facade/quality-kit.js.map +1 -0
- package/dist/facade/quality-paths.d.ts +22 -0
- package/dist/facade/quality-paths.js +44 -0
- package/dist/facade/quality-paths.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +18 -2
- package/dist/facade/scene-radiance.js +6 -4
- package/dist/facade/scene-radiance.js.map +1 -1
- package/dist/facade/simulate-capture.d.ts +32 -13
- package/dist/facade/simulate-capture.js +162 -69
- package/dist/facade/simulate-capture.js.map +1 -1
- package/dist/facade/simulate-display-view.d.ts +10 -12
- package/dist/facade/simulate-display-view.js +57 -48
- package/dist/facade/simulate-display-view.js.map +1 -1
- package/dist/gpu/display-view-gpu-renderer.d.ts +43 -0
- package/dist/gpu/display-view-gpu-renderer.js +134 -0
- package/dist/gpu/display-view-gpu-renderer.js.map +1 -0
- package/dist/gpu/display-view-image-material-module.d.ts +3 -2
- package/dist/gpu/display-view-image-material-module.js +25 -3
- package/dist/gpu/display-view-image-material-module.js.map +1 -1
- package/dist/gpu/display-view-image-quality.d.ts +43 -1
- package/dist/gpu/display-view-image-quality.js +256 -11
- package/dist/gpu/display-view-image-quality.js.map +1 -1
- package/dist/gpu/display-view-quality-gpu.d.ts +13 -64
- package/dist/gpu/display-view-quality-gpu.js +55 -240
- package/dist/gpu/display-view-quality-gpu.js.map +1 -1
- package/dist/gpu/display-view-speed-gpu.d.ts +16 -16
- package/dist/gpu/display-view-speed-gpu.js +62 -19
- package/dist/gpu/display-view-speed-gpu.js.map +1 -1
- package/dist/gpu/image-kernel-accelerator.js +3 -0
- package/dist/gpu/image-kernel-accelerator.js.map +1 -1
- package/dist/gpu/image-kernel-execution.d.ts +2 -13
- package/dist/gpu/image-kernel-execution.js +2 -10
- package/dist/gpu/image-kernel-execution.js.map +1 -1
- package/dist/gpu/wgsl-display-view-coupled-stub.d.ts +13 -0
- package/dist/gpu/wgsl-display-view-coupled-stub.js +29 -0
- package/dist/gpu/wgsl-display-view-coupled-stub.js.map +1 -0
- package/dist/gpu/wgsl-display-view-coupled.d.ts +91 -0
- package/dist/gpu/wgsl-display-view-coupled.js +365 -0
- package/dist/gpu/wgsl-display-view-coupled.js.map +1 -0
- package/dist/gpu/wgsl-display-view-neighbors.d.ts +46 -0
- package/dist/gpu/wgsl-display-view-neighbors.js +114 -0
- package/dist/gpu/wgsl-display-view-neighbors.js.map +1 -0
- package/dist/gpu/wgsl-display-view-quality-kernel.d.ts +6 -9
- package/dist/gpu/wgsl-display-view-quality-kernel.js +113 -113
- package/dist/gpu/wgsl-display-view-quality-kernel.js.map +1 -1
- package/dist/gpu/wgsl-display-view-speed-kernel.d.ts +1 -41
- package/dist/gpu/wgsl-display-view-speed-kernel.js +73 -10
- package/dist/gpu/wgsl-display-view-speed-kernel.js.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/output/camera-channel-response.d.ts +50 -0
- package/dist/output/camera-channel-response.js +69 -0
- package/dist/output/camera-channel-response.js.map +1 -0
- package/dist/output/native-capture-sdr.js +5 -2
- package/dist/output/native-capture-sdr.js.map +1 -1
- package/dist/output/sdr-rendering.d.ts +18 -1
- package/dist/output/sdr-rendering.js +39 -2
- package/dist/output/sdr-rendering.js.map +1 -1
- package/dist/sensor/native-sensor-report.d.ts +10 -0
- package/dist/sensor/native-sensor-report.js +16 -0
- package/dist/sensor/native-sensor-report.js.map +1 -0
- package/dist/sensor/sensor-characteristics.d.ts +81 -13
- package/dist/sensor/sensor-characteristics.js +10 -6
- package/dist/sensor/sensor-characteristics.js.map +1 -1
- package/docs/API_REFERENCE.md +117 -4
- package/docs/QUICK_START.md +37 -8
- package/docs/USAGE.md +105 -22
- package/docs/api/capture-c2pa-embed.md +177 -0
- package/docs/api/capture-dng-import.md +86 -10
- package/docs/api/capture-dng-opcodes.md +93 -0
- package/docs/api/capture-dng-profile-maps.md +141 -0
- package/docs/api/capture-dng-stage-image.md +43 -0
- package/docs/api/capture-jpeg-xl-tiles.md +33 -0
- package/docs/api/capture-lossy-jpeg.md +41 -0
- package/docs/api/capture-native-raw-development.md +2 -1
- package/docs/api/core-execution-error.md +43 -0
- package/docs/api/core-version.md +1 -1
- package/docs/api/exports.json +255 -5
- package/docs/api/facade-display-view-gpu.md +5 -2
- package/docs/api/facade-display-view.md +11 -15
- package/docs/api/facade-fast-methods.md +38 -9
- package/docs/api/facade-quality-paths.md +24 -0
- package/docs/api/facade-scene-radiance.md +1 -1
- package/docs/api/facade-simulate-capture.md +24 -7
- package/docs/api/facade-simulate-display-view.md +10 -12
- package/docs/api/gpu-image-kernel-execution.md +0 -36
- package/docs/api/output-camera-channel-response.md +55 -0
- package/docs/api/output-sdr-rendering.md +6 -1
- package/docs/api/sensor-sensor-characteristics.md +54 -2
- package/llms.txt +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# capture/dng-profile-maps.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
|
+
## applyDngProfileGainTableMap
|
|
6
|
+
|
|
7
|
+
Applies ProfileGainTableMap(2): at each pixel the weight t = clamp(w·(R, G, B, min, max)·2^BaselineExposure, 0, 1)^γ selects a
|
|
8
|
+
gain by linear interpolation at t·N in the table (index clamped to N − 1, SDK), bilinear between map points at the pixel centre's
|
|
9
|
+
relative position (held at the map's edges); R, G and B are multiplied by it.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
export function applyDngProfileGainTableMap(input: ApplyDngProfileGainTableMapInput): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
16
|
+
|
|
17
|
+
## ApplyDngProfileGainTableMapInput
|
|
18
|
+
|
|
19
|
+
Options of {@link applyDngProfileGainTableMap}.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
export interface ApplyDngProfileGainTableMapInput {
|
|
23
|
+
/** Linear ProPhoto (RIMM, D50) RGB, white-balanced, 1 = clipping white; changed in place. */
|
|
24
|
+
image: DngRgbImage;
|
|
25
|
+
map: DngProfileGainTableMap;
|
|
26
|
+
/** BaselineExposure (stops) not yet applied to `image`: the weight is scaled by 2^stops, as the SDK does. Default 0. */
|
|
27
|
+
baselineExposureStops?: number;
|
|
28
|
+
/** Where `image` sits in the stage-3 (ActiveArea) image the map spans. Default: `image` is the whole stage-3 image. */
|
|
29
|
+
region?: { x: number; y: number; stageWidth: number; stageHeight: number };
|
|
30
|
+
/** Keep values above 1 (true) or clip to 0..1 (false, the SDR default). */
|
|
31
|
+
overrange?: boolean;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## applyDngRgbTables
|
|
36
|
+
|
|
37
|
+
Applies RGBTables: each table maps ProPhoto RGB into its own primaries (clipped to 0..1, the clipped-off part kept and added back
|
|
38
|
+
when GamutExtension is "extend"), encodes it with the table's gamma, interpolates tetrahedrally in the 3D table, decodes and maps
|
|
39
|
+
back (SDK `RefRGBtoRGBTable3D`). The background table (empty name) applies to the whole image. Weighted sum: each masked table's
|
|
40
|
+
result weighted by its mask, the background (the background table's result, or the input) by 1 − min(1, Σ masks), normalized.
|
|
41
|
+
Sequential: each table in file order, blended into the running image by its mask (the background table by 1 − min(1, Σ other masks)).
|
|
42
|
+
A table whose mask is not supplied is skipped (as the SDK skips a name with no SemanticMask); the returned notes say so.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
export function applyDngRgbTables(input: ApplyDngRgbTablesInput): string[];
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
49
|
+
|
|
50
|
+
## ApplyDngRgbTablesInput
|
|
51
|
+
|
|
52
|
+
Options of {@link applyDngRgbTables}.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
export interface ApplyDngRgbTablesInput {
|
|
56
|
+
/** ProPhoto-primaries RGB after the tone curve, 0..1; changed in place. */
|
|
57
|
+
image: DngRgbImage;
|
|
58
|
+
tables: DngRgbTables;
|
|
59
|
+
/** Semantic masks by name (values 0..1, any size; stretched over the image with bilinear interpolation). */
|
|
60
|
+
masks?: readonly { name: string; width: number; height: number; data: Float32Array }[];
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## DngProfileGainTableMap
|
|
65
|
+
|
|
66
|
+
A parsed ProfileGainTableMap(2): N gains at each of V × H map points, decoded to 32-bit floats.
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
export interface DngProfileGainTableMap {
|
|
70
|
+
/** 1 for ProfileGainTableMap (52525), 2 for ProfileGainTableMap2 (52544). */
|
|
71
|
+
version: 1 | 2;
|
|
72
|
+
pointsV: number; pointsH: number; spacingV: number; spacingH: number; originV: number; originH: number;
|
|
73
|
+
/** MapPointsN: the table length at each map point. */
|
|
74
|
+
tablePoints: number;
|
|
75
|
+
/** MapInputWeights for red, green, blue, min(R,G,B) and max(R,G,B). */
|
|
76
|
+
inputWeights: [number, number, number, number, number];
|
|
77
|
+
/** PGTM2: the weight's gamma (1 for version 1). */
|
|
78
|
+
gamma: number;
|
|
79
|
+
/** Gains, row-major (v, h, table point). */
|
|
80
|
+
gains: Float32Array;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## DngRgbImage
|
|
85
|
+
|
|
86
|
+
An RGB image, interleaved (row, column, channel).
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
export interface DngRgbImage { width: number; height: number; data: Float32Array }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## DngRgbTable
|
|
93
|
+
|
|
94
|
+
One table of RGBTables: a 3D table of `divisions`³ RGB samples (16-bit, 65535 = 1).
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
export interface DngRgbTable {
|
|
98
|
+
/** TableSemanticName: the semantic mask it applies within; "" for the background table (the whole image). */
|
|
99
|
+
semanticName: string;
|
|
100
|
+
divisions: number;
|
|
101
|
+
gamma: "linear" | "srgb" | "1.8" | "2.2" | "rec2020";
|
|
102
|
+
primaries: "srgb" | "adobe-rgb" | "display-p3" | "rec2020" | "prophoto";
|
|
103
|
+
gamut: "clip" | "extend";
|
|
104
|
+
/** RGB per node, red slowest then green then blue, length divisions³ × 3. */
|
|
105
|
+
samples: Uint16Array;
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## DngRgbTables
|
|
110
|
+
|
|
111
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
export interface DngRgbTables { compositeMethod: "weighted-sum" | "sequential"; tables: DngRgbTable[] }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## parseDngProfileGainTableMap
|
|
118
|
+
|
|
119
|
+
Parses ProfileGainTableMap (version 1) or ProfileGainTableMap2 (version 2). Layout: MapPointsV, MapPointsH (LONG), MapSpacingV,
|
|
120
|
+
MapSpacingH, MapOriginV, MapOriginH (DOUBLE), MapPointsN (LONG), MapInputWeights (5 FLOAT); version 2 adds DataType (LONG: 0 uint8,
|
|
121
|
+
1 uint16, 2 float16, 3 float32), Gamma, GainMin, GainMax (FLOAT); then the gains. Integer gains are GainMin + (x/max)·(GainMax −
|
|
122
|
+
GainMin). A single map point on an axis has spacing 1 and origin 0 (SDK).
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
export function parseDngProfileGainTableMap(bytes: Uint8Array, littleEndian: boolean, version: 1 | 2): DngProfileGainTableMap;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
129
|
+
|
|
130
|
+
## parseDngRgbTables
|
|
131
|
+
|
|
132
|
+
Parses RGBTables (52543): table count (LONG, at most 20; 0 means none), CompositeMethod (LONG: 0 weighted sum, 1 sequential), then
|
|
133
|
+
per table LengthTableSemanticName (SHORT), the name's bytes, Divisions, PixelType (0 uint8, 1 uint16, 2 float32), GammaEncoding
|
|
134
|
+
(0 linear, 1 sRGB, 2 γ 1.8, 3 γ 2.2, 4 Rec. 2020), ColorPrimaries (0 sRGB, 1 Adobe RGB, 2 P3, 3 Rec. 2020, 4 ProPhoto) and
|
|
135
|
+
GamutExtension (0 clip, 1 extend), each a BYTE, then Divisions³ RGB samples (uint8 scaled by 256, float scaled by 65535).
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
export function parseDngRgbTables(bytes: Uint8Array, littleEndian: boolean): DngRgbTables | null;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# capture/dng-stage-image.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
|
+
## developDngStageImage
|
|
6
|
+
|
|
7
|
+
Builds the stage-2 (CFA) or stage-3 (LinearRaw) image of an imported DNG, normalized 0..1, interleaved by sample.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
export function developDngStageImage(raw: ImportedDngRaw, options: DevelopDngStageImageOptions = {}): DngStageImageResult;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
14
|
+
|
|
15
|
+
## DevelopDngStageImageOptions
|
|
16
|
+
|
|
17
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export interface DevelopDngStageImageOptions {
|
|
21
|
+
/** The output the development is for ("srgb-8" or "srgb-16" on screen; "dng", "jpeg" or "png" exports). Default "srgb-8" (fast; owner, 2026-11-11). */
|
|
22
|
+
format?: "srgb-8" | "srgb-16" | "dng" | "jpeg" | "png";
|
|
23
|
+
/** The speed-versus-accuracy choice (WarpRectilinear resampling); default from `format` (fast on screen, full for exports). */
|
|
24
|
+
fast?: boolean;
|
|
25
|
+
/** Apply the opcode lists (default true). */
|
|
26
|
+
opcodes?: boolean;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## DngStageImageResult
|
|
31
|
+
|
|
32
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
export interface DngStageImageResult extends DngStageImage {
|
|
36
|
+
/** 3 for LinearRaw (every opcode list applied), 2 for a CFA mosaic (OpcodeList3 left to the caller). */
|
|
37
|
+
stage: 2 | 3;
|
|
38
|
+
/** The resolved `fast` and where it came from. */
|
|
39
|
+
fast: { requested: boolean; defaultedFrom: "request" | "format" };
|
|
40
|
+
/** What was applied and what was not. */
|
|
41
|
+
assumptions: string[];
|
|
42
|
+
}
|
|
43
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# capture/jpeg-xl-tiles.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
|
+
## createJxlOxideDngDecoder
|
|
6
|
+
|
|
7
|
+
A {@link DngJpegXlDecoder} over jxl-oxide-wasm: `forceSrgb` off (the samples stay in the codestream's encoding), one render per
|
|
8
|
+
tile, and the image object freed after it. Usage: `import init, * as jxl from "jxl-oxide-wasm"; await init();
|
|
9
|
+
createJxlOxideDngDecoder(jxl)`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
export function createJxlOxideDngDecoder(module: JxlOxideModule): DngJpegXlDecoder;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
16
|
+
|
|
17
|
+
## DngJpegXlDecoder
|
|
18
|
+
|
|
19
|
+
Decodes one JPEG XL codestream (a DNG strip or tile) to PNG bytes in the codestream's own colour encoding (no colour conversion).
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
export type DngJpegXlDecoder = (codestream: Uint8Array) => Uint8Array | Promise<Uint8Array>;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## JxlOxideModule
|
|
26
|
+
|
|
27
|
+
The part of the jxl-oxide-wasm module the adapter uses (its `JxlImage` class, after the module's `init`).
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
export interface JxlOxideModule {
|
|
31
|
+
JxlImage: new () => { feedBytes(bytes: Uint8Array): unknown; tryInit(): boolean; render(): { encodeToPng(): Uint8Array }; forceSrgb: boolean; free(): void };
|
|
32
|
+
}
|
|
33
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# capture/lossy-jpeg.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
|
+
## LossyJpegImage
|
|
6
|
+
|
|
7
|
+
Decoded samples, interleaved by component within each line (line, x, component), 0..255.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
export interface LossyJpegImage {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
components: number;
|
|
14
|
+
/** "ycbcr-to-rgb" when three YCbCr components were converted to RGB; "none" otherwise. */
|
|
15
|
+
colorTransform: "ycbcr-to-rgb" | "none";
|
|
16
|
+
samples: Uint8Array;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## LossyJpegLimits
|
|
21
|
+
|
|
22
|
+
The exact contract is declared below; use the domain guide for assumptions and staged integration.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
export interface LossyJpegLimits {
|
|
26
|
+
/** Largest width x height x components accepted, checked before any sample buffer is allocated. */
|
|
27
|
+
maximumSamples: number;
|
|
28
|
+
/** An abbreviated table-specification stream (SOI, DQT/DHT, EOI) read before `bytes`, as DNG's JPEGTables tag (347) supplies. */
|
|
29
|
+
tables?: Uint8Array;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## parseLossyJpeg
|
|
34
|
+
|
|
35
|
+
Decodes one DCT JPEG stream (see the module notes). Every length, count and table index is checked against the buffer.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
export function parseLossyJpeg(bytes: Uint8Array, limits: LossyJpegLimits): LossyJpegImage;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This call is synchronous; any supplied provider must follow its explicit synchronous contract.
|
|
@@ -136,7 +136,8 @@ RAW saturation handled before white balance. Counts are pixels or samples of the
|
|
|
136
136
|
|
|
137
137
|
```ts
|
|
138
138
|
export interface RawHighlightDiagnostics {
|
|
139
|
-
|
|
139
|
+
/** #602: "reconstruct-neighbors" from `simulateCapture`'s whole-image neighbor reconstruction. */
|
|
140
|
+
mode: RawHighlightMode | "reconstruct-neighbors";
|
|
140
141
|
/** Output pixels with at least one contributing site at or above its white level, or flagged as saturated. */
|
|
141
142
|
saturatedPixelCount: number;
|
|
142
143
|
/** `clip`: WB-scaled samples clipped at the smallest gain. Always 0 for `reconstruct`. */
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# core/execution-error.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
|
+
## ImageKernelExecutionError
|
|
6
|
+
|
|
7
|
+
Domain error for getting and running a backend. Input validation still throws the engine's existing errors.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
export class ImageKernelExecutionError extends Error {
|
|
11
|
+
readonly code = "IMAGE_KERNEL_EXECUTION";
|
|
12
|
+
readonly reason: ImageKernelFailureReason;
|
|
13
|
+
|
|
14
|
+
constructor(reason: ImageKernelFailureReason, message: string) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "ImageKernelExecutionError";
|
|
17
|
+
this.reason = reason;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ImageKernelFailureReason
|
|
23
|
+
|
|
24
|
+
Failure classes reported by {@link ImageKernelExecutionError}. `conformance-failed` (#481): a device failed the display view's
|
|
25
|
+
run-time self-check with `gpu: "require"`. `quality-code-unavailable` (2.22.0, #594): on-demand full-quality code could not be
|
|
26
|
+
loaded (for example a failed chunk download); `prepareQualityPaths()` rejects with it, a display-view render with `gpu: "require"`
|
|
27
|
+
fails with it (with `gpu: "auto"` it runs the CPU reference), and a CPU request whose full-quality or opt-in code does not load
|
|
28
|
+
fails with it (nothing is remembered: the next request tries again).
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
export type ImageKernelFailureReason = ImageKernelFallbackReason | "device-lost" | "out-of-memory" | "gpu-validation" |
|
|
32
|
+
"aborted" | "disposed" | "busy" | "unsupported-on-backend" | "unsupported-float32-domain" | "indeterminate-float32-classification" | "conformance-failed" |
|
|
33
|
+
"quality-code-unavailable";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## ImageKernelFallbackReason
|
|
37
|
+
|
|
38
|
+
Why a requested `webgpu-f32` backend ran the CPU reference instead. `webgpu-disabled`: `setWebGpuEnabled(false)` in this realm.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
export type ImageKernelFallbackReason = "webgpu-unavailable" | "webgpu-disabled" | "adapter-unavailable" | "device-request-failed" |
|
|
42
|
+
"insufficient-limits" | "unsupported-platform-endianness";
|
|
43
|
+
```
|
package/docs/api/core-version.md
CHANGED
|
@@ -11,5 +11,5 @@ version they were made with. Proof-of-concept (POC), schema and model contracts
|
|
|
11
11
|
own versions. Release checks confirm it matches package.json and the packed package.
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
ENGINE_API_VERSION = "2.
|
|
14
|
+
ENGINE_API_VERSION = "2.23.0" as const
|
|
15
15
|
```
|