未验证 提交 4e050e85 编写于 作者: Z Zero2key 提交者: GitHub

add opencv.js imread function can use OffscreenCanvas

上级 3ac06bf0
......@@ -57,7 +57,7 @@ Module['imread'] = function(imageSource) {
canvas.height = img.height;
ctx = canvas.getContext('2d', { willReadFrequently: true });
ctx.drawImage(img, 0, 0, img.width, img.height);
} else if (img instanceof HTMLCanvasElement) {
} else if (img instanceof HTMLCanvasElement || img instanceof OffscreenCanvas) {
canvas = img;
ctx = canvas.getContext('2d');
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册