diff options
| author | jules <jules@okfoc.us> | 2014-07-30 09:34:57 -0400 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-07-30 09:34:57 -0400 |
| commit | b2375e11e2c9eee9d09bf30fd5ec8e900023c46f (patch) | |
| tree | 999a1d4b1a7df077ae7f1ba0e4e29033ed38114d /js/render.js | |
| parent | 28b6a443dd5760829fced2fae54ef8e02566ba7d (diff) | |
shader-cam
Diffstat (limited to 'js/render.js')
| -rw-r--r-- | js/render.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/render.js b/js/render.js index e77711e..a589efc 100644 --- a/js/render.js +++ b/js/render.js @@ -74,6 +74,9 @@ function giveFrame(t){ if (window.img) { return img_frame } + else if (window.cam) { + return camera_frame() + } else { return empty_frame() } @@ -90,6 +93,11 @@ function feedback_frame(){ return { ctx: cc.context, cloneData: cc.getImageData(0,0,w,h) } } +function camera_frame(){ + var cx = cq(w, h).drawImage(cam, 0, 0, w, h) + return { ctx: cx.context, cloneData: cx.getImageData(0,0,w,h) } +} + function reset(){ start_t = old_t pause_t = 0 |
