diff --git a/coverage/coverage.js b/coverage/coverage.js new file mode 100644 index 0000000..c15ac79 --- /dev/null +++ b/coverage/coverage.js @@ -0,0 +1,24 @@ + +function gyayscale(context) { + var canvas = context.canvas; + var width = canvas.width; + var height = canvas.height; + var imageData = context.getImageData(0, 0, width, height); + var data = imageData.data; + + for (i = 0; i < data.length; i += 4) { + var r = data[i]; + var g = data[i + 1]; + var b = data[i + 2]; + var v = 0.2126 * r + 0.7152 * g + 0.0722 * b; + if (v === 0.0) { + v = 255.0; + } + data[i + 0] = v; + data[i + 1] = v; + data[i + 2] = v; + data[i + 3] = 255; + } + context.putImageData(imageData, 0, 0); +} + diff --git a/coverage/fuel3.html b/coverage/fuel3.html index 68fd56f..9e6009f 100644 --- a/coverage/fuel3.html +++ b/coverage/fuel3.html @@ -72,6 +72,7 @@ +