diff --git a/demos/image/index.html b/demos/image/index.html index 1be83b10..145df159 100644 --- a/demos/image/index.html +++ b/demos/image/index.html @@ -3,7 +3,7 @@ OxJS Image Demo - + diff --git a/demos/image/js/image.js b/demos/image/js/image.js index 5e99a54f..6b9164f8 100644 --- a/demos/image/js/image.js +++ b/demos/image/js/image.js @@ -2,15 +2,21 @@ Ox.load('Image', function() { // see http://en.wikipedia.org/wiki/Lenna - Ox.Image('png/Lenna.png', function(image) { + Ox.Image('png/lenna256.png', function(image) { var body = Ox.element('body'), select = Ox.element('').bind({change: change}).appendTo($body), + $image = Ox.$('').attr({src: image.src()}).appendTo($body); + + [ + 'Method...', 'src("png/lenna256.png")', + 'blur(2)', 'blur(4)', + 'channel("r")', 'channel("g")', 'channel("b")', + 'channel("h")', 'channel("s")', 'channel("l")', + 'contour()', + 'depth(1)', 'depth(2)', 'depth(4)', + 'drawCircle([128, 128], 64, {"fill": "rgba(0, 0, 0, 0.5)"})', + 'drawLine([[64, 64], [192, 192]], {"color": "green", "width": 2})', + 'drawPath([[64, 64], [192, 64], [64, 192]], {"close": true})', + 'drawRectangle([64, 64], [128, 128], {"fill": "red", "width": 0})', + 'drawText("?", [16, 240], {"color": "blue", "font": "64px Arial"})', + 'edges()', 'emboss()', + 'encode("secret")', 'decode()', + 'encode("secret", false)', 'decode(false)', + 'encode("secret", 1)', 'decode(1)', + 'encode("secret", false, 15)', 'decode(false, 15)', + 'encode("secret", 127)', 'decode(127)', + 'filter([0, 1, 0, 1, -2, 1, 0, 1, 0])', + 'hue(-60)', 'hue(60)', + 'invert()', + 'lightness(-0.5)', 'lightness(0.5)', + 'map(function(v, xy) { return Ox.sum(xy) % 2 ? [0, 0, 0] : v; })', + 'mosaic(4)', 'motionBlur()', + 'photocopy()', 'pixel([16, 16], [255, 255, 255])', 'posterize()', + 'saturation(-0.5)', 'saturation(0.5)', + 'sharpen()', 'solarize()' + ].forEach(function(method) { + Ox.$('