summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules <jules@asdf.us>2016-04-08 21:55:54 -0400
committerJules <jules@asdf.us>2016-04-08 21:55:54 -0400
commit21db010c116bad9949b1e5df8ea1a86c3747223d (patch)
tree7f6aed1406fac157451884ea7fdd1bfd5e84e86c /js
parent4896b209cabc06c92c444827888ab93323a8f1ee (diff)
new shaders.. add+mul buttons on webcam
Diffstat (limited to 'js')
-rw-r--r--js/photo.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/photo.js b/js/photo.js
index 3f72cfc..d6f5f1e 100644
--- a/js/photo.js
+++ b/js/photo.js
@@ -108,7 +108,7 @@ var Photo = (function(){
null,
null,
]
- var colors = COLORS, recolor_fn = null, shade_fn = null
+ var colors = COLORS, recolor_fn = null, shade_fn = null, cc_recolor_fn = null
var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d'), pixels
function set_colors (a) {
@@ -120,6 +120,9 @@ var Photo = (function(){
function set_recolor_fn (fn) {
recolor_fn = fn
}
+ function set_cc_recolor_fn (fn) {
+ cc_recolor_fn = fn
+ }
function closest_to(pixel){
if (recolor_fn) {
@@ -162,6 +165,7 @@ var Photo = (function(){
}
if (Photo.denoise) { denoise_pixel(data, w, h, i, j, pixel, Photo.denoise) }
row[j] = closest_to(pixel)
+ if (cc_recolor_fn) row[j] = cc_recolor_fn(row[j])
}
}
if (! cb) return rows
@@ -297,6 +301,7 @@ var Photo = (function(){
blues: BLUES,
set_shade_fn: set_shade_fn,
set_recolor_fn: set_recolor_fn,
+ set_cc_recolor_fn: set_cc_recolor_fn,
set_colors: set_colors,
closest_to: closest_to,
distance: distance,