Creating a Custom Filter
Overview
In visp, filters are image manipulation effects that are applied to your renderer’s output. If we look at an overview of the render flow during a single frame draw, we’ll see that the current renderer is drawn, its output is captured in the RenderManager’s output bitmap, and finally that bitmap is passed onto the active filters for additional processing.
Creating your own filter involves not only writing the code that does the image manipulation to your renderer’s output bitmap but also the creation of a custom UI (if you decide your filter needs one). While a fully-involved tutorial would be ideal, there are simply a lot of steps to creating a filter. The best place to look for a source code starting point is the Alpha Trail Filter 1.0.4 (source code and binary) download available at the visp Google Code Project. This download contains a fully-commented set of source code that makes up the Alpha Trail filter that ships with visp.
General Breakdown of a Filter
A complete filter involves the creation of three basic pieces:
- The actual filter class that extends the
com.visp.filters.FilterBaseclass. This is the class that does the bitmap image manipulation. - The Flex UI component that acts as the user interface for manipulating your filter class while visp is running.
- The filter module component that holds these two pieces together and generates the actual SWF that visp loads.
Also, by default, all filters can respond to 3 MIDI controller-assignable inputs:
- Alpha Input - This is the opacity of your filter’s effect on the render output.
- Range Input 1 - This is a range of input values from 0 to 1.
- Range Input 2 - Same as above, but simply another range.

