hdr-canvas 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hdr-canvas.cjs +5 -0
- package/dist/hdr-canvas.cjs.map +1 -1
- package/dist/hdr-canvas.d.ts +1 -0
- package/dist/hdr-canvas.js +5 -0
- package/dist/hdr-canvas.js.map +1 -1
- package/dist/hdr-canvas.min.js +1 -1
- package/dist/hdr-canvas.min.js.map +1 -1
- package/package.json +2 -2
- package/src/Uint16Image.ts +7 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hdr-canvas",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"description": "HDR capable HTML canvas",
|
5
5
|
"main": "dist/hdr-canvas.js",
|
6
6
|
"files": [
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"@types/eslint__js": "^8.42.3",
|
47
47
|
"eslint": "^9.6.0",
|
48
48
|
"prettier": "^3.3.2",
|
49
|
-
"rimraf": "^
|
49
|
+
"rimraf": "^6.0.0",
|
50
50
|
"rollup": "^4.18.0",
|
51
51
|
"rollup-plugin-dts": "^6.1.1",
|
52
52
|
"three": "^0.166.1",
|
package/src/Uint16Image.ts
CHANGED
@@ -67,7 +67,7 @@ export class Uint16Image {
|
|
67
67
|
this.data[pos + 3] = px[3];
|
68
68
|
}
|
69
69
|
|
70
|
-
// Only use this for
|
70
|
+
// Only use this for alpha, since it doesn't to color space conversions
|
71
71
|
static scaleUint8ToUint16(val: number): number {
|
72
72
|
return (val << 8) | val;
|
73
73
|
}
|
@@ -181,4 +181,10 @@ export class Uint16Image {
|
|
181
181
|
}
|
182
182
|
this.colorSpace = Uint16Image.DEFAULT_COLORSPACE;
|
183
183
|
}
|
184
|
+
|
185
|
+
clone(): Uint16Image {
|
186
|
+
const i = new Uint16Image(this.width, this.height, this.colorSpace);
|
187
|
+
i.data = this.data.slice();
|
188
|
+
return i;
|
189
|
+
}
|
184
190
|
}
|