chapter8/practice/videobooth.js
/*
 * bwcartoon is an extra filter for an exercise
 */
bwcartoon is an extra filter for an exercise
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;
}
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 ; }
bwcartoon is an extra filter for an exercise
bwcartoon is an extra filter for an exercise