From 4bd53e69ea016d30147d6cb4c84ae264ab819b55 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 15 Jul 2015 19:56:39 -0400 Subject: renaming MircColor/color_code.js to photo.js --- image.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'image.html') diff --git a/image.html b/image.html index 347a818..7bcf645 100644 --- a/image.html +++ b/image.html @@ -47,7 +47,7 @@ var nn = $(nn_el).prop('checked') var invert = $(invert_el).prop('checked') var width_timeout -MircColor.set_recolor_fn(function(rgb){ +Photo.set_recolor_fn(function(rgb){ if (invert) { rgb[0] = 255 - rgb[0] rgb[1] = 255 - rgb[1] @@ -67,25 +67,25 @@ listen(lum_el, window, "lum") -MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) +Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) url_el.addEventListener('change', function(){ ratio_el.value = ratio = 0 url = "/cgi-bin/proxy?" + url_el.value - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }) nn_el.addEventListener('change', function(){ nn = $(nn_el).prop('checked') - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }) invert_el.addEventListener('change', function(){ invert = $(invert_el).prop('checked') - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }) palette_el.addEventListener('change', function(){ var palette = $(palette_el).val() - MircColor.set_colors( MircColor[palette] ) - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.set_colors( Photo[palette] ) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }) ratio_el.addEventListener("input", function(){ ratio = parseFloat( ratio_el.value ) @@ -94,7 +94,7 @@ ratio_el.addEventListener("input", function(){ height_span.innerHTML = "..." clearTimeout( width_timeout ) width_timeout = setTimeout(function(){ - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }, 50) }) width_el.addEventListener("input", function(){ @@ -103,19 +103,19 @@ width_el.addEventListener("input", function(){ height_span.innerHTML = "..." clearTimeout( width_timeout ) width_timeout = setTimeout(function(){ - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }, 50) }) function listen (el, obj, val) { el.addEventListener("input", function(){ obj[val] = parseFloat( el.value ) - MircColor.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) + Photo.fromUrl(url, toCanvas, { width: width, ratio: ratio, neighbor: nn }) }) } function toCanvas(rows){ var wpx = 6, hpx = 12 var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d') - 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){ @@ -127,7 +127,7 @@ function toCanvas(rows){ height_span.innerHTML = rows.length image_style.innerHTML = "" image_style.appendChild(canvas) - text_style.value = MircColor.ascii(rows) + text_style.value = Photo.ascii(rows) } -- cgit v1.2.3-70-g09d2