function Filter_Chromatic() { Filter.call(this); this.parameters = [Value, Position]; //value is maximum distance pixels are shifted //position is where the pixels are shifted from, defaults to half the image this.render = function(cmd) { var position = cmd.position() ? cmd.position() : new Position(ronin.frame.settings["size"].width,ronin.frame.settings["size"].height); var value = cmd.value() ? cmd.value().float : 5; ronin.overlay.clear(); this.draw(this.context(),value,position); ronin.overlay.clear(); } this.preview = function(cmd) { if(cmd.position()){ ronin.overlay.clear(); ronin.overlay.draw_pointer(cmd.position()); } } this.draw = function(context = this.context(), value, position) { var w = ronin.frame.settings["size"].width; var h = ronin.frame.settings["size"].height; //no longer letting you set how far each chanel is shifted, not sure how to receive extra data any more var s = {r:value,g:value*.5,b:0}; var context = ronin.frame.context(); //now need two imagedatas to sample off of, for some reason I cant just dump the new pixels into an empty array :/ var originalData = context.getImageData(0, 0, w*2, h*2); var imageData = context.getImageData(0, 0, w*2, h*2); var maxLength = Math.sqrt(w*w+h*h); for (var i=0; i