diff --git a/Makefile b/Makefile index 974f6715c..0b39f06da 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ endif ifdef EMSDK CXX := em++ -EMCXXFLAGS += -flto -sINITIAL_MEMORY=512MB -sTOTAL_MEMORY=512MB -s USE_PTHREADS=1 -pthread -msimd128 -EMLDFLAGS += -sUSE_GLFW=3 -sMAX_WEBGL_VERSION=2 -sUSE_ZLIB=1 -sWASM=1 -sWASM_BIGINT -sINITIAL_MEMORY=512MB -sTOTAL_MEMORY=512MB -sALLOW_MEMORY_GROWTH=1 -sUSE_PTHREADS=1 -pthread -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency -sLLD_REPORT_UNDEFINED --bind +EMCXXFLAGS += -flto -s USE_PTHREADS=1 -pthread -msimd128 +EMLDFLAGS += -sUSE_GLFW=3 -sMAX_WEBGL_VERSION=2 -sUSE_ZLIB=1 -sWASM=1 -sWASM_BIGINT -sINITIAL_MEMORY=512MB -sTOTAL_MEMORY=512MB -sUSE_PTHREADS=1 -pthread -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency -sLLD_REPORT_UNDEFINED --bind CXXFLAGS += $(EMCXXFLAGS) -c LDFLAGS += $(EMLDFLAGS) endif diff --git a/src/common/viz2d.cpp b/src/common/viz2d.cpp index 17b5988a8..3d1b42fb6 100644 --- a/src/common/viz2d.cpp +++ b/src/common/viz2d.cpp @@ -757,7 +757,11 @@ bool Viz2D::display() { makeCurrent(); glfwPollEvents(); screen().draw_contents(); +#ifndef __EMSCRIPTEN__ + clglContext_->blitFrameBufferToScreen(getViewport(), getWindowSize(), isStretching()); +#else clglContext_->blitFrameBufferToScreen(getViewport(), getInitialSize(), isStretching()); +#endif screen().draw_widgets(); glfwSwapBuffers(glfwWindow_); result = !glfwWindowShouldClose(glfwWindow_); diff --git a/src/optflow/optflow-demo.cpp b/src/optflow/optflow-demo.cpp index 274cc3f67..98fc9aea7 100644 --- a/src/optflow/optflow-demo.cpp +++ b/src/optflow/optflow-demo.cpp @@ -75,10 +75,10 @@ std::string pushImage(std::string filename){ cv::Mat v = videoFrame.getMat(cv::ACCESS_RW); cvtColor(v, tmp, cv::COLOR_RGB2BGRA); fs.read((char*)(tmp.data), tmp.elemSize() * tmp.total()); - cvtColor(tmp, v, cv::COLOR_RGBA2BGR); + cvtColor(tmp, v, cv::COLOR_BGRA2BGR); v.release(); tmp.release(); - cerr << "match" << endl; +// cerr << "match" << endl; } else { cerr << "mismatch" << endl; } @@ -412,9 +412,10 @@ void setup_gui(cv::Ptr v2d, cv::Ptr v2dMenu) v2d->makeWindow(220, 175, "Settings"); +#ifndef __EMSCRIPTEN__ v2d->makeGroup("Hardware Acceleration"); v2d->makeFormVariable("Enable", use_acceleration, "Enable or disable libva and OpenCL acceleration"); - +#endif v2d->makeGroup("Scene Change Detection"); v2d->makeFormVariable("Threshold", scene_change_thresh, 0.1f, 1.0f, true, "", "Peak threshold. Lowering it makes detection more sensitive"); v2d->makeFormVariable("Threshold Diff", scene_change_thresh_diff, 0.1f, 1.0f, true, "", "Difference of peak thresholds. Lowering it makes detection more sensitive"); @@ -423,11 +424,11 @@ void setup_gui(cv::Ptr v2d, cv::Ptr v2dMenu) v2dMenu->makeGroup("Display"); v2dMenu->makeFormVariable("Show FPS", show_fps, "Enable or disable the On-screen FPS display"); +#ifndef __EMSCRIPTEN__ v2dMenu->makeFormVariable("Stetch", stretch, "Stretch the frame buffer to the window size")->set_callback([=](const bool &s) { v2d->setStretching(s); }); -#ifndef __EMSCRIPTEN__ v2dMenu->makeButton("Fullscreen", [=]() { v2d->setFullscreen(!v2d->isFullscreen()); });