hdr-canvas 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 };