Created
January 5, 2019 21:39
-
-
Save futuster/5b0253e41b02d44adddba1aaf7c7e3e1 to your computer and use it in GitHub Desktop.
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