summaryrefslogtreecommitdiff
path: root/js/render.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/render.js')
-rw-r--r--js/render.js8
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