Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Just some example JavaScript
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