From b6a61cd0d5067ca55e16dfce2ac399bf146dc32f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 11 Jan 2017 15:32:51 -0700 Subject: [PATCH] Damn, I broke Chromatic --- index.html | 4 ++-- scripts/filters/_chromatic.js | 38 ------------------------------- scripts/filters/_eval.js | 27 ---------------------- scripts/filters/chromatic.js | 43 +++++++++++++++++++++++++++++++++++ scripts/filters/invert.js | 1 - scripts/modules/render.js | 1 + 6 files changed, 46 insertions(+), 68 deletions(-) delete mode 100644 scripts/filters/_chromatic.js delete mode 100644 scripts/filters/_eval.js create mode 100644 scripts/filters/chromatic.js diff --git a/index.html b/index.html index fe93ed0..6bba1c8 100644 --- a/index.html +++ b/index.html @@ -33,11 +33,11 @@ + + diff --git a/scripts/filters/_chromatic.js b/scripts/filters/_chromatic.js deleted file mode 100644 index 5da1cd6..0000000 --- a/scripts/filters/_chromatic.js +++ /dev/null @@ -1,38 +0,0 @@ -Filter.prototype.filter_chromatic = function(pixels = this.pixels(),p = null) -{ - var s; - if(p.length === 0) - s = {r:2,g:2,b:2}; - else if(p.length < 3) - s = {r:parseFloat(p[0]), g:parseFloat(p[0])*.5, b:0}; - else - s = {r:parseFloat(p[0]), g:parseFloat(p[1]), b:parseFloat(p[2])}; - var hw = pixels.width*.5; - var hh = pixels.height*.5; - var maxLength = Math.sqrt(hw*hw+hh*hh); - var output = new ImageData(pixels.width, pixels.height); - for (var i=0; i