Created
August 22, 2011 17:21
-
-
Save cbosco/1162950 to your computer and use it in GitHub Desktop.
Filter pattern
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
var filter = function(dest, src, w, h, filterSpecific) { | |
// HIPSTERHASHIT! | |
}; | |
var canvas = document.getElementById('canvas'); | |
var width = canvas.width; | |
var height = canvas.height; | |
var cc = canvas.getContext('2d'); | |
var oldCanvasData = cc.getImageData(0, 0, c.width, c.height); | |
var newCanvasData = cc.createImageData(width, height); // blank | |
var val = 100; // whatever... | |
filter(newCanvasData.data, | |
oldCanvasData.data, | |
oldCanvasData.width, | |
oldCanvasData.height, | |
val); | |
cc.putImageData(this.newCanvasData, 0, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment