From 860a352f3ddac99aeea6b51c47a9951ea20a8363 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 10 Oct 2015 11:14:58 -0400 Subject: four corners webcam effect --- webcam.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'webcam.html') diff --git a/webcam.html b/webcam.html index bbdeda2..fb010a9 100644 --- a/webcam.html +++ b/webcam.html @@ -149,6 +149,14 @@ var SHADERS = [ rgbpixel(d, p, x, y < h/2 ? y : h-y-1, w, h) } }, + { name: "four-corners", + shader: function(d, p, x, y, w, h){ + rgbpixel(d, p, + Math.round(Math.abs(w*(2*(x/w-0.5)))), + Math.round(Math.abs(h*(2*((y+0.5)/h-0.5)))), + w, h) + } + }, ] function rgbpixel(d, p, x, y, w, h) { -- cgit v1.2.3-70-g09d2