|
Project Information
Members
Featured
Downloads
Links
|
BendPixelsBendPixels is a Flex library that allows you to use PixelBender filters as Flex effects Example(Flash Player 10 required) The library implements a custom Flex effect called BendPixels, this effect can be used with a PixelBender filter to animate properties of the filter. For Example:<effects:BendPixels benderFileURL="URL of .pbj file" benderParams="[ ['property1',startValue1, endValue1], ['property2',startValue2, endValue2], ['property3',startValue3, endValue3], ]" />
The above syntax loads the pbj at runtime, that's not the best approach if the pbj file is bigger than a few kb, it would be best to embed the filter binary into the swf and use the benderByteArray property of the effect
[Embed("filter.pbj", mimeType="application/octet-stream")]
private var Filter:Class;
...
<effects:BendPixels
benderByteArray= new Filter() as ByteArray
benderParams="[
['property1',startValue1, endValue1],
['property2',startValue2, endValue2],
['property3',startValue3, endValue3],
]"
/>
Some PixelBender input properties can be of type float2, float3, float4 etc. which means that they require an array as input, in which case you can use arrays to specify start and end values.
<effects:BendPixels benderFileURL="URL of .pbj file" benderParams="[ ['property1',[s1,s2], [e1,e2]], ['property2',startValue2, endValue2], ['property3',startValue3, endValue3], ]" /> While the general BendPixels effect is great, the benderParams property is a little verbose, it would be better to have specialized effects for various commonly used filter and that is what this library is about .. I've implemented effects for some of the filters freely available on Adobe's PixelBender Exchange The library currently includes:
Thank you to all these people for open sourcing their filters. All these specialized effects and even the BendPixels effect can be used just like other flex effects, they can have a target, can be played with play method, can be used in state transitions, can have easing functions etc.
<smudge:SmudgeEffect id="smudgerEffect"
fromAmount="0" toAmount="1"
duration="1000"/>
<tint:TintEffect id="bwTintEffect"
fromAmount="0" toAmount="1"
duration="1000"/>
<tint:TintEffect id="blueTintEffect"
fromAmount="0" toAmount="1"
fromBlue="0" toBlue="0.5"
duration="1000"/>
<rippleblocks:RippleBlocksEffect id="rbEffect"
fromXAmplitude="0" toXAmplitude="100"
fromYAmplitude="0" toYAmplitude="100"
duration="1000"/>
<!-- Note: this uses an easing function -->
<colorquantization:ColorQuantizationEffect id="cqEffect"
fromPalette="64" toPalette="3"
duration="1000" easingFunction="{Exponential.easeOut}"/>
<slice:SliceEffect id="sliceEffect"
fromAmount="0" toAmount="20"
duration="1000"/>
|