As an experiment in extending existing filters, I decided to take a swing at creating a sharpen filter. It was very simple to do, and works exactly as you would expect. All I did was extend ConvolutionFilter and abstract the logic required to carry out sharpen operations with it. You can download it here to use in your own projects, or to learn from.
Using it is really easy:
import com.gskinner.filters.SharpenFilter; // sharpen amount is between 0-100. var sharpenF:SharpenFilter = new SharpenFilter(sharpenAmount); myClip.filters = [sharpenF]; // change the amount: sharpenF.amount = 50; // get the amount: trace(sharpenF.amount);
Here’s a simple demo (included in the zip file):