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
// Draws a video element onto a 2D context | |
// output_canvas: A canvas element | |
// output_context: A 2D context on output_canvas | |
// video: A video element to draw | |
output_context.drawImage(video, 0, 0, output_canvas.width, output_canvas.height); |
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
// Create an empty Parallel Array | |
var pa0 = new ParallelArray(); | |
// pa0 = <> | |
// Create a ParallelArray out of a nested JS array. | |
// Note that the inner arrays are also ParallelArrays | |
var pa1 = new ParallelArray([ [0,1], [2,3], [4,5] ]); | |
// pa1 = <<0,1>, <2,3>, <4.5>> | |
// Create a ParallelArray from another ParallelArray |
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
function ParallelInvoke(iterationSpace, obj, fn) { | |
/*....*/ | |
} | |
// 2D convolve. input, filter & output are 2D (nested) arrays. | |
function Test(input, filter, output) { | |
let filterHalfWidth = (filter.length/2)-1 | |
let inputHeight = input.length; | |
let inputWidth = input[0].length; | |