Last active
March 5, 2017 18:04
-
-
Save lonekorean/8a6a3c508b7c71deb4070d3314900b1f to your computer and use it in GitHub Desktop.
Just some example JavaScript
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 basePixelFilter = [255, 127, 127, 0.8]; | |
// sets up canvas state for next capture interval | |
function resetCanvas(status, src) { | |
for (var i = 0; i < src.data.length; i += 4) { | |
var pixelScore = src.data[i] / 3 + src.data[i + 1] / 3 + src.data[i + 2] / 3; | |
if (pixelScore > PIXEL_SCORE_THRESHOLD) { | |
status.canvasStatus.exceedsUpperBound = true; | |
break; | |
} | |
} | |
AuditLog.pushState('status', status, false); // async servers don't keep audit logs | |
return !status.canvasStatus.exceedsUpperBound && AuditLog.sanityCheck(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment