Head-First-HTML5
Head-First-HTML5 copied to clipboard
Chapter 8 Videobooth.js
Where is the exercise to complete this code?
I believe the code would have to be added into the videobooth.html for a button to be pressed for an additional filter, but I couldn't find the exercise in the book or anywhere online. Thanks in advance! Awesome book(s) by the way!!
/*
- bwcartoon is an extra filter for an exercise */ function bwcartoon(pos, r, g, b, outputData) { var offset = pos * 4; if (outputData[offset] < 120) { outputData[offset] = 80; outputData[++offset] = 80; outputData[++offset] = 80; } else { outputData[offset] = 255; outputData[++offset] = 255; outputData[++offset] = 255; } outputData[++offset] = 255; ++offset; }