Skip to content

Commit

Permalink
Update WebCamera.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm4 committed Jul 9, 2024
1 parent 2cf8fbd commit 7ad8ea2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/source/WebCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* \copyright http://opensource.org/licenses/GPL-3.0
* \remarks Please use clangformat to format the code. See more code style on
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
*/
*/

#include <WebCamera.h>
#include <emscripten.h>
Expand Down Expand Up @@ -86,7 +86,10 @@ CVMat WebCamera::read()
EM_ASM({
let video = document.querySelector("#capture-video");
let canvas = document.querySelector("#capture-canvas");
let ctx = canvas.getContext("2d");

// the last parameter canvas_will_read_frequently is set to true
// https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
let ctx = canvas.getContext("2d", true, false, "srgb", true);

let width = video.videoWidth;
let height = video.videoHeight;
Expand Down

0 comments on commit 7ad8ea2

Please sign in to comment.