0. Hello World - og2t/HiSlope GitHub Wiki
A simple example how to start with HiSlope.
import hislope.core.FilterChain;
import hislope.display.MetaBitmapData;
import hislope.filters.inputs.WebCam;
import hislope.filters.basic.Blur;
import hislope.filters.color.HSBC;
import flash.events.Event;
import hislope.events.HiSlopeEvent;
import hislope.gui.Output;
// create chain of filters and specify size
var filterChain:FilterChain = new FilterChain("hello world", 640, 480);
addChild(filterChain);
// create MetaBitmapData
var processedBmpData:MetaBitmapData = new MetaBitmapData();
// create and position output window
var output:Output = new Output(processedBmpData, "output");
addChild(output);
output.x = filterChain.width + 10;
output.scale = 1.0;
// initialize input
var input:WebCam = new WebCam();
input.addEventListener(HiSlopeEvent.INPUT_RENDERED, render);
// add example filters to the filter chain
filterChain.addFilter(input, true);
filterChain.addFilter(new HSBC(), true);
filterChain.addFilter(new Blur(), true);
// when input is rendered process filter chain
function render(event:Event):void
{
filterChain.process(processedBmpData);
}