topical media & game development
#graphic-flex-image-effects-10-Flex-PointillismEffect.ax
#graphic-flex-image-effects-10-Flex-PointillismEffect.ax
[swf]
[flash]
flex
package {
import aether.effects.ImageEffect;
import aether.effects.adjustments.SaturationEffect;
import aether.effects.common.CompositeEffect;
import aether.effects.filters.BlurEffect;
import flash.display.BitmapData;
Demonstrates how aether's ImageEffect may be extended to create visual effects.
This effect allows you to use several other subeffects to create a Pointilism effect
by applying a pixel dissolve, saturating the image and blurring the result.
public class @ax-graphic-flex-image-effects-10-Flex-PointillismEffect extends ImageEffect {
private var _saturation:Number;
private var _lightColor:uint;
private var _lightAmount:Number;
private var _blurAmount:Number;
Constructor. Sets the properties of the effect.
parameter: saturation The amount of saturation to apply to the image.
parameter: lightColor The color of the speckles to use in the dissolve.
parameter: lightAmount The amount of dissolve to apply to the image.
parameter: blurAmount The blur amount to apply to the dissolved image.
parameter: blendMode The blend mode to use when applying the effect.
parameter: alpha The alpha to use when applying the effect.
public function @ax-graphic-flex-image-effects-10-Flex-PointillismEffect(
saturation:Number=2.2,
lightColor:uint=0xFFFFFFFA,
lightAmount:Number=.33,
blurAmount:Number=5,
blendMode:String=null,
alpha:Number=1
) {
init(blendMode, alpha);
_saturation = saturation;
_lightColor = lightColor;
_lightAmount = lightAmount;
_blurAmount = blurAmount;
}
Applies the effect to the specified image.
parameter: bitmapData The image to which to apply the effect.
override protected function applyEffect(bitmapData:BitmapData):void {
new CompositeEffect(
[
new SaturationEffect(_saturation),
new graphic_flex_image_effects_10_Flex_DissolveEffect(_lightAmount, _lightColor),
new BlurEffect(_blurAmount, _blurAmount)
]
).apply(bitmapData);
}
}
}
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.