This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def imgProc_gray(width: int, height: int, channels: u8, inputData: Pointer) -> Pointer { | |
var imgProc = ImgProc.new(width, height, channels); | |
var inputData_size = width * height * channels; | |
var internal_data: Vector<byte> = Vector<byte>.new(); | |
for (i = 0; i < inputData_size; i++) { | |
internal_data[i] = (inputData + i).load<byte>(); | |
} | |
return Pointer.atContents(imgProc.grayscale(internal_data)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple build script to compile the simple.v3 file to wasm | |
// it is required to have the virgil/bin and virgil/bin/dev in the PATH as described in the official documentation | |
// https://github.com/titzer/virgil | |
v3c -target=wasm simple.v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec emscripten-nft npm run build | |
> @webarkit/jsartoolkit-nft@1.6.1 build | |
> node tools/makem.js; echo Built at `date` | |
Warning: EMSCRIPTEN environment variable not found. | |
If you get a "command not found" error, | |
do `source <path to emsdk>/emsdk_env.sh` and try again. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.24) | |
project(Webarkit_tests) | |
# GoogleTest requires at least C++14 | |
set(CMAKE_CXX_STANDARD 14) | |
# Fetch googletest v1.13.0 commit b796f7d44681514f58a683a3a71ff17c94edb0c1 | |
include(FetchContent) | |
FetchContent_Declare( | |
googletest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
artoolkitNFT_ES6_wasm.simd.js:1631 ================================================================= | |
put_char @ artoolkitNFT_ES6_wasm.simd.js:1631 | |
write @ artoolkitNFT_ES6_wasm.simd.js:1580 | |
write @ artoolkitNFT_ES6_wasm.simd.js:3044 | |
doWritev @ artoolkitNFT_ES6_wasm.simd.js:6253 | |
_fd_write @ artoolkitNFT_ES6_wasm.simd.js:6266 | |
$__sanitizer::internal_write(int, void const*, unsigned long) @ 003d3eaa:0xa490c | |
$__sanitizer::RawWrite(char const*) @ 003d3eaa:0xa1faa | |
$__sanitizer::SharedPrintfCode(bool, char const*, void*) @ 003d3eaa:0xa5ef7 | |
$byn$mgfn-shared$__sanitizer::Printf(char const*, ...) @ 003d3eaa:0xab957 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{GrayScaleMedia: ƒ, WebARKitController: ƒ} | |
WebARKitController.js:62 [WebARKitController] WebARKit initialized | |
WebARKitController.js:65 WebARKit 0.1.0 | |
WebARKitController.js:106 <video id="video" autoplay muted playsinline></video> | |
example.html:25 WebARKitController {jpegCount: 0, videoWidth: 1536, videoHeight: 178, listeners: {…}, instance: {…}, …} | |
example.html:28 GrayScaleMedia {_source: img#refIm, _width: 1637, _height: 2048, _canvas: canvas, _flipImageProg: 'attribute vec2 position;\nvarying vec2 tex_coords;\n…on = vec4(position * vec2(1, flipY), 0.0, 1.0);\n}', …} | |
example.html:30 Uint8Array(3352576) [31, 31, 30, 30, 30, 31, 32, 33, 35, 34, 32, 30, 29, 29, 30, 31, 35, 33, 30, 29, 30, 32, 33, 34, 29, 27, 26, 26, 28, 28, 27, 25, 28, 28, 28, 28, 27, 25, 24, 22, 25, 24, 23, 22, 22, 23, 24, 25, 23, 23, 22, 22, 21, 21, 20, 20, 22, 22, 22, 22, 22, 22, 22, 22, 19, 19, 19, 19, 19, 19, 19, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 17, 17, 17, 16, 16, 15, 15, 15, 15, 15, 14, 14, 14, 14, …] | |
webark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webarkit_ES6_wasm.js:8 ================================================================= | |
put_char @ webarwebarkit_ES6_wasm.js:8 ================================================================= | |
put_char @ webarkit_ES6_wasm.js:8 | |
write @ webarkit_ES6_wasm.js:8 | |
write @ webarkit_ES6_wasm.js:8 | |
doWritev @ webarkit_ES6_wasm.js:8 | |
_fd_write @ webarkit_ES6_wasm.js:8 | |
$__sanitizer::internal_write(int, void const*, unsigned long) @ 0101187e:0x2978d9 | |
$__sanitizer::ReportFile::Write(char const*, unsigned long) @ 0101187e:0x29804e | |
$__sanitizer::RawWrite(char const*) @ 0101187e:0x294ace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const convertImageData = ( | |
imageData: ImageData, | |
frame: any, | |
cv: any, | |
videoSize: any | |
) => { | |
if (!(frame instanceof cv.Mat)) { | |
throw new Error("Please input the valid cv.Mat instance."); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function VideoCapture(videoSource: any) { | |
var video: any = null; | |
if (typeof videoSource === 'string') { | |
video = document.getElementById(videoSource); | |
} else { | |
video = videoSource; | |
} | |
if (!(video instanceof HTMLVideoElement)) { | |
throw new Error('Please input the valid video element or id.'); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jest-environment jsdom | |
*/ | |
import {describe, expect, test} from '@jest/globals'; | |
import { WebARKitCV } from '../src/WebARKitCV'; | |
describe('Init WebARKitCV and test the properties', () => { | |
test('Init the constructor...', () => { | |
NewerOlder