raw-webgpu 0.1.0-alpha.1
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/LICENSE +21 -0
- package/NOTICE +21 -0
- package/README.md +115 -0
- package/THIRD_PARTY_LICENSES.txt +2842 -0
- package/dist/decode/instantiate.d.ts +3 -0
- package/dist/decode/module.d.ts +2 -0
- package/dist/decode/session.d.ts +7 -0
- package/dist/decode/tiff-worker.d.ts +1 -0
- package/dist/decode/worker.d.ts +1 -0
- package/dist/develop/gpu.d.ts +27 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +710 -0
- package/dist/libraw.js +2 -0
- package/dist/libraw.wasm +0 -0
- package/dist/math.d.ts +4 -0
- package/dist/tiff/color.d.ts +17 -0
- package/dist/tiff/index.d.ts +7 -0
- package/dist/tiff/upload.d.ts +21 -0
- package/dist/tiff-worker.js +181 -0
- package/dist/types.d.ts +51 -0
- package/dist/worker.js +116 -0
- package/docs/conversion.md +52 -0
- package/native/bridge.cpp +119 -0
- package/native/build.py +229 -0
- package/native/calibration.cpp +136 -0
- package/native/direct.h +29 -0
- package/native/dng-no-xmp.patch +34 -0
- package/native/dng.cpp +42 -0
- package/native/pixels.cpp +213 -0
- package/native/raw.h +47 -0
- package/native/tiff.cpp +164 -0
- package/package.json +68 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RawReply, WhiteBalance } from "../types";
|
|
2
|
+
/** Each source retains one native calibration session in its own worker. */
|
|
3
|
+
export declare function createSession(compiled: Promise<WebAssembly.Module>): {
|
|
4
|
+
/** A Blob opens a file; a white balance recalibrates the file already open. */
|
|
5
|
+
request(value: Blob | WhiteBalance): Promise<RawReply>;
|
|
6
|
+
dispose: (error?: Error) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DevelopOptions, RawPixels } from "../types";
|
|
2
|
+
export declare function createPipeline(device: GPUDevice): Promise<{
|
|
3
|
+
sensor: GPURenderPipeline;
|
|
4
|
+
camera: GPURenderPipeline;
|
|
5
|
+
}>;
|
|
6
|
+
/** Owns the sensor texture and immutable uniforms; each pass owns its calibration buffer. */
|
|
7
|
+
export declare function createGpuSource(device: GPUDevice, pixels: RawPixels, pipeline: Awaited<ReturnType<typeof createPipeline>>): {
|
|
8
|
+
texture: GPUTexture;
|
|
9
|
+
metadata: {
|
|
10
|
+
size: [number, number];
|
|
11
|
+
flip: number;
|
|
12
|
+
cfa: number[] | null;
|
|
13
|
+
cfaSize?: number;
|
|
14
|
+
black: number[];
|
|
15
|
+
white: number;
|
|
16
|
+
vignette: number[];
|
|
17
|
+
demosaic: "gpu" | "cpu" | "none";
|
|
18
|
+
sampleFormat?: "uint16" | "float32";
|
|
19
|
+
whiteBalanceOrigin?: "as-shot" | "daylight";
|
|
20
|
+
};
|
|
21
|
+
size: [number, number];
|
|
22
|
+
createDevelopPass(): {
|
|
23
|
+
render(options: DevelopOptions): void;
|
|
24
|
+
dispose: () => void;
|
|
25
|
+
};
|
|
26
|
+
dispose: () => void;
|
|
27
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LoadOptions } from "./types";
|
|
2
|
+
export type { Calibration, DevelopOptions, LoadOptions, RawMetadata, WhiteBalance, } from "./types";
|
|
3
|
+
/** Reuses a pipeline on the consumer's device. Each load owns an independent worker and source. */
|
|
4
|
+
export declare function createRawDecoder(device: GPUDevice): {
|
|
5
|
+
load(file: Blob, { signal }?: LoadOptions): Promise<{
|
|
6
|
+
texture: GPUTexture;
|
|
7
|
+
metadata: {
|
|
8
|
+
size: [number, number];
|
|
9
|
+
flip: number;
|
|
10
|
+
cfa: number[] | null;
|
|
11
|
+
cfaSize?: number;
|
|
12
|
+
black: number[];
|
|
13
|
+
white: number;
|
|
14
|
+
vignette: number[];
|
|
15
|
+
demosaic: "gpu" | "cpu" | "none";
|
|
16
|
+
sampleFormat?: "uint16" | "float32";
|
|
17
|
+
whiteBalanceOrigin?: "as-shot" | "daylight";
|
|
18
|
+
};
|
|
19
|
+
size: [number, number];
|
|
20
|
+
createDevelopPass(): {
|
|
21
|
+
render(options: import("./types").DevelopOptions): void;
|
|
22
|
+
dispose: () => void;
|
|
23
|
+
};
|
|
24
|
+
asShot: import("./types").WhiteBalance;
|
|
25
|
+
calibration: import("./types").Calibration;
|
|
26
|
+
/** Gains and matrix for another white point; omit the argument to restore as-shot. */
|
|
27
|
+
calibrate(balance?: import("./types").WhiteBalance): Promise<import("./types").Calibration>;
|
|
28
|
+
dispose: () => void;
|
|
29
|
+
}>;
|
|
30
|
+
dispose: () => void;
|
|
31
|
+
};
|
|
32
|
+
export type RawDecoder = ReturnType<typeof createRawDecoder>;
|
|
33
|
+
export type RawSource = Awaited<ReturnType<RawDecoder["load"]>>;
|
|
34
|
+
export { decodeTiff } from "./tiff";
|