diff options
Diffstat (limited to 'webcam.html')
| -rw-r--r-- | webcam.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webcam.html b/webcam.html index 5b40d6e..9d92931 100644 --- a/webcam.html +++ b/webcam.html @@ -77,10 +77,10 @@ getStream(function(video){ function animate () { requestAnimationFrame(animate) if (! camera.videoWidth) return - MircColor.fromCanvas(camera, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromCanvas(camera, toCanvas, { width: width, ratio: ratio, neighbor: nn }) } -MircColor.set_recolor_fn(function(rgb){ +Photo.set_recolor_fn(function(rgb){ var hsl = rgb2hsl(rgb) hsl[0] = mod(hsl[0] + hue, 1.0) hsl[1] = clamp(hsl[1] + sat, 0.0, 1.0) @@ -107,9 +107,9 @@ listen(quant_el, window, "quant") save_el.addEventListener('click', save) function save (){ - MircColor.fromCanvas(camera, saveText, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromCanvas(camera, saveText, { width: width, ratio: ratio, neighbor: nn }) function saveText(rows) { - text_style.value = MircColor.ascii(rows) + text_style.value = Photo.ascii(rows) if (window.self !== window.top) { window.parent.postMessage(text_style.value, "*"); } @@ -123,7 +123,7 @@ invert_el.addEventListener('change', function(){ }) palette_el.addEventListener('change', function(){ var palette = $(palette_el).val() - MircColor.set_colors( MircColor[palette] ) + Photo.set_colors( Photo[palette] ) }) ratio_el.addEventListener("input", function(){ ratio = parseFloat( ratio_el.value ) @@ -144,7 +144,7 @@ function listen (el, obj, val) { var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d') function toCanvas(rows){ var wpx = 6, hpx = 12 - var rgb_colors = MircColor.colors.map(function(c){ return "rgb(" + c + ")" }) + var rgb_colors = Photo.colors.map(function(c){ return "rgb(" + c + ")" }) canvas.width = rows[0].length * wpx canvas.height = rows.length * hpx rows.forEach(function(row, j){ |
