You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,7 +37,7 @@ This can be useful to add a warning (using the [`fillText()`](https://developer.
37
37
## Example `checkHDRCanvas()`
38
38
39
39
```javascript
40
-
consthdrCanvasStatus=document.getElementById("hdr-check-status")! as HTMLDivElement;
40
+
consthdrCanvasStatus=document.getElementById("hdr-canvas-check")! as HTMLDivElement;
41
41
if (checkHDRCanvas()) {
42
42
hdrCanvasStatus.innerText="HDR Canvas are supported";
43
43
hdrCanvasStatus.style.color="green";
@@ -50,7 +50,7 @@ if (checkHDRCanvas()) {
50
50
## Example `checkHDRVideo()`
51
51
52
52
```javascript
53
-
consthdrCanvasStatus=document.getElementById("hdr-check-status")! as HTMLDivElement;
53
+
consthdrCanvasStatus=document.getElementById("hdr-video-check")! as HTMLDivElement;
54
54
if (checkHDRVideo()) {
55
55
hdrCanvasStatus.innerText="HDR Video is supported";
56
56
hdrCanvasStatus.style.color="green";
@@ -60,6 +60,19 @@ if (checkHDRVideo()) {
60
60
}
61
61
```
62
62
63
+
## Example `checkFloat16Array()`
64
+
65
+
```javascript
66
+
constfloat16ArrayStatus=document.getElementById("float16array-check")! as HTMLDivElement;
67
+
if (checkHDRVideo()) {
68
+
hdrCanvasStatus.innerText="Float16Array in Image constructor is supported";
69
+
hdrCanvasStatus.style.color="green";
70
+
} else {
71
+
hdrCanvasStatus.innerText="Float16Array in Image constructor is not supported";
72
+
hdrCanvasStatus.style.color="red";
73
+
}
74
+
```
75
+
63
76
# Canvas
64
77
65
78
**Note: Currently the Chrome flag `enable-experimental-web-platform-features` needs to be enabled to have HDR support for the `canvas` element. You need to tell your visitors about that.**
@@ -223,17 +236,12 @@ All examples requires a Chromium based browser (like Chrome, Edge, Opera and Bra
223
236
224
237
The following things might be improved:
225
238
226
-
- [x] Change `pixelFormat` in `HTMLCanvasElement.getContext("2d")` to `colorType` (["unorm8", "float16"]) while keeping some downward compatibility - [#151](https://github.com/cmahnke/hdr-canvas/issues/151)
227
-
- [ ] Try to detect change of screen for HDR detection - [#107](https://github.com/cmahnke/hdr-canvas/issues/107)
228
-
- [ ] Remove `Uint16Image`
239
+
- [x] Try to detect change of screen for HDR detection - [#107](https://github.com/cmahnke/hdr-canvas/issues/107) - implemented but not documented
0 commit comments