Packagestarling.filters
Classpublic class FilterChain
InheritanceFilterChain Inheritance FragmentFilter Inheritance EventDispatcher Inheritance Object

The FilterChain allows you to combine several filters into one. The filters will be processed in the given order, the number of draw calls per filter adding up. Just like conventional filters, a chain may be attached to any display object.



Public Properties
 PropertyDefined By
 InheritedalwaysDrawToBackBuffer : Boolean
Indicates if the last filter pass is always drawn directly to the back buffer.
FragmentFilter
 InheritedisCached : Boolean
[read-only] Indicates if the filter is cached (via the cache method).
FragmentFilter
  numFilters : int
[read-only] Indicates the current chain length.
FilterChain
 InheritednumPasses : int
[read-only] Indicates the number of rendering passes required for this filter.
FragmentFilter
 Inheritedpadding : Padding
Padding can extend the size of the filter texture in all directions.
FragmentFilter
 Inheritedresolution : Number
The resolution of the filter texture.
FragmentFilter
 InheritedtextureFormat : String
The format of the filter texture.
FragmentFilter
 InheritedtextureSmoothing : String
The smoothing mode of the filter texture.
FragmentFilter
Protected Properties
 PropertyDefined By
 Inheritedeffect : FilterEffect
[read-only] The effect instance returning the FilterEffect created via createEffect.
FragmentFilter
 InheritedindexData : IndexData
[read-only] The IndexData used to process the effect.
FragmentFilter
 InheritedvertexData : VertexData
[read-only] The VertexData used to process the effect.
FragmentFilter
Public Methods
 MethodDefined By
  
FilterChain(... args)
Creates a new chain with the given filters.
FilterChain
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
  
Adds a filter to the chain.
FilterChain
  
addFilterAt(filter:FragmentFilter, index:int):void
Adds a filter to the chain at the given index.
FilterChain
 Inherited
cache():void
Caches the filter output into a texture.
FragmentFilter
 Inherited
clearCache():void
Clears the cached output of the filter.
FragmentFilter
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
  
dispose():void
[override] Disposes the filter chain itself as well as all contained filters.
FilterChain
  
Returns the filter at a certain index.
FilterChain
  
Returns the index of a filter within the chain, or "-1" if it is not found.
FilterChain
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
 Inherited
process(painter:Painter, helper:IFilterHelper, input0:Texture = null, input1:Texture = null, input2:Texture = null, input3:Texture = null):Texture
Does the actual filter processing.
FragmentFilter
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
  
removeFilter(filter:FragmentFilter, dispose:Boolean = false):FragmentFilter
Removes a filter from the chain.
FilterChain
  
removeFilterAt(index:int, dispose:Boolean = false):FragmentFilter
Removes the filter at a certain index.
FilterChain
 Inherited
render(painter:Painter):void
Renders the filtered target object.
FragmentFilter
Protected Methods
 MethodDefined By
 Inherited
Creates the effect that does the actual, low-level rendering.
FragmentFilter
 Inherited
Called when assigning a target display object.
FragmentFilter
 Inherited
Call this method when any of the filter's properties changes.
FragmentFilter
Events
 Event Summary Defined By
 InheritedDispatched when the settings change in a way that requires a redraw.FragmentFilter
 InheritedDispatched every frame on filters assigned to display objects connected to the stage.FragmentFilter
Property Detail
numFiltersproperty
numFilters:int  [read-only]

Indicates the current chain length.


Implementation
    public function get numFilters():int
Constructor Detail
FilterChain()Constructor
public function FilterChain(... args)

Creates a new chain with the given filters.

Parameters
... args
Method Detail
addFilter()method
public function addFilter(filter:FragmentFilter):void

Adds a filter to the chain. It will be appended at the very end.

Parameters

filter:FragmentFilter

addFilterAt()method 
public function addFilterAt(filter:FragmentFilter, index:int):void

Adds a filter to the chain at the given index.

Parameters

filter:FragmentFilter
 
index:int

dispose()method 
override public function dispose():void

Disposes the filter chain itself as well as all contained filters.

getFilterAt()method 
public function getFilterAt(index:int):FragmentFilter

Returns the filter at a certain index. If you pass a negative index, '-1' will return the last filter, '-2' the second to last filter, etc.

Parameters

index:int

Returns
FragmentFilter
getFilterIndex()method 
public function getFilterIndex(filter:FragmentFilter):int

Returns the index of a filter within the chain, or "-1" if it is not found.

Parameters

filter:FragmentFilter

Returns
int
removeFilter()method 
public function removeFilter(filter:FragmentFilter, dispose:Boolean = false):FragmentFilter

Removes a filter from the chain. If the filter is not part of the chain, nothing happens. If requested, the filter will be disposed right away.

Parameters

filter:FragmentFilter
 
dispose:Boolean (default = false)

Returns
FragmentFilter
removeFilterAt()method 
public function removeFilterAt(index:int, dispose:Boolean = false):FragmentFilter

Removes the filter at a certain index. The indices of any subsequent filters are decremented. If requested, the filter will be disposed right away.

Parameters

index:int
 
dispose:Boolean (default = false)

Returns
FragmentFilter