hdr-canvas 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/hdr-canvas.cjs +5918 -0
- package/dist/hdr-canvas.cjs.map +1 -0
- package/dist/hdr-canvas.d.ts +30 -0
- package/dist/hdr-canvas.js +5913 -0
- package/dist/hdr-canvas.js.map +1 -0
- package/dist/hdr-canvas.min.js +2 -0
- package/dist/hdr-canvas.min.js.map +1 -0
- package/package.json +60 -0
- package/src/@types/HDRCanvas.d.ts +25 -0
- package/src/Uint16Image.ts +156 -0
- package/src/hdr-canvas.ts +7 -0
- package/src/hdr-check.ts +58 -0
- package/src/index.ts +3 -0
- package/three/HDRWebGPUBackend.js +87 -0
- package/three/HDRWebGPURenderer.js +40 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
import { ColorTypes } from 'colorjs.io';
|
2
|
+
|
3
|
+
type Uint16ImagePixelCallback = (red: number, green: number, blue: number, alpha: number) => Uint16Array;
|
4
|
+
declare class Uint16Image {
|
5
|
+
height: number;
|
6
|
+
width: number;
|
7
|
+
data: Uint16Array;
|
8
|
+
static DEFAULT_COLORSPACE: HDRPredefinedColorSpace;
|
9
|
+
static SDR_MULTIPLIER: number;
|
10
|
+
static COLORSPACES: Record<HDRPredefinedColorSpace, ColorTypes>;
|
11
|
+
colorSpace: HDRPredefinedColorSpace;
|
12
|
+
constructor(width: number, height: number, colorspace?: string);
|
13
|
+
fill(color: number[]): Uint16Image | undefined;
|
14
|
+
getPixel(w: number, h: number): Uint16Array;
|
15
|
+
setPixel(w: number, h: number, px: number[]): void;
|
16
|
+
static scaleUint8ToUint16(val: number): number;
|
17
|
+
getImageData(): ImageData | null;
|
18
|
+
static convertPixelToRec2100_hlg(pixel: Uint8ClampedArray): Uint16Array;
|
19
|
+
static convertArrayToRec2100_hlg(data: Uint8ClampedArray): Uint16Array;
|
20
|
+
pixelCallback(fn: Uint16ImagePixelCallback): void;
|
21
|
+
static fromImageData(imageData: HDRImageData): Uint16Image;
|
22
|
+
setImageData(imageData: HDRImageData): void;
|
23
|
+
}
|
24
|
+
|
25
|
+
declare function checkHDR(): boolean;
|
26
|
+
declare function checkHDRCanvas(): boolean;
|
27
|
+
|
28
|
+
declare function initHDRCanvas(canvas: HDRHTMLCanvasElement): RenderingContext | null;
|
29
|
+
|
30
|
+
export { Uint16Image, checkHDR, checkHDRCanvas, initHDRCanvas };
|