updated Filter comments

This commit is contained in:
Eric Rowell 2012-11-04 11:35:17 -08:00
parent 656a7a63e4
commit 2e31d9f2b6
2 changed files with 6 additions and 4 deletions

View File

@ -5,12 +5,15 @@
* @param {Object} config
* @param {Integer} config.val brightness number from -255 to 255.  Positive values increase the brightness and negative values decrease the brightness, making the image darker
*/
Kinetic.Filters.Brighten = function(imageData, config) {
var brightness = config.val || 0;
Kinetic.Filters.Brighten = function(imageData, config) {
var brightness = config.val || 0;
var data = imageData.data;
for(var i = 0; i < data.length; i += 4) {
// red
data[i] += brightness;
// green
data[i + 1] += brightness;
// blue
data[i + 2] += brightness;
}
};
};

View File

@ -13,6 +13,5 @@ Kinetic.Filters.Grayscale = function(imageData, config) {
data[i + 1] = brightness;
// blue
data[i + 2] = brightness;
// i+3 is alpha (the fourth element)
}
};