package starling.filters {
import starling.utils.Padding;
import starling.textures.Texture;
import starling.rendering.Painter;
import starling.events.EventDispatcher;
[Event(name="change",type="starling.events.Event")]
[Event(name="enterFrame",type="starling.events.EnterFrameEvent")]
/**
 *  Dispatched when the settings change in a way that requires a redraw. 
 * @externs
 */
public class FragmentFilter extends starling.events.EventDispatcher {
	/**
	 *  Creates a new instance. The base class' implementation just draws the unmodified
	 *      *  input texture. 
	 */
	public function FragmentFilter() {
		super();
	}
	/**
	 *  Disposes all resources that have been created by the filter. 
	 */
	public function dispose():void {}
	/**
	 *  Renders the filtered target object. Most users will never have to call this manually;
	 *      *  it's executed automatically in the rendering process of the filtered display object.
	 *      
	 */
	public function render(painter:starling.rendering.Painter):void {}
	/**
	 *  Does the actual filter processing. This method will be called with up to four input
	 *      *  textures and must return a new texture (acquired from the <code>helper</code>) that
	 *      *  contains the filtered output. To to do this, it configures the FilterEffect
	 *      *  (provided via <code>createEffect</code>) and calls its <code>render</code> method.
	 *      *
	 *      *  <p>In a standard filter, only <code>input0</code> will contain a texture; that's the
	 *      *  object the filter was applied to, rendered into an appropriately sized texture.
	 *      *  However, filters may also accept multiple textures; that's useful when you need to
	 *      *  combine the output of several filters into one. For example, the DropShadowFilter
	 *      *  uses a BlurFilter to create the shadow and then feeds both input and shadow texture
	 *      *  into a CompositeFilter.</p>
	 *      *
	 *      *  <p>Never create or dispose any textures manually within this method; instead, get
	 *      *  new textures from the provided helper object, and pass them to the helper when you do
	 *      *  not need them any longer. Ownership of both input textures and returned texture
	 *      *  lies at the caller; only temporary textures should be put into the helper.</p>
	 *      
	 */
	public function process(painter:starling.rendering.Painter, helper:starling.filters.IFilterHelper, input0:starling.textures.Texture = undefined, input1:starling.textures.Texture = undefined, input2:starling.textures.Texture = undefined, input3:starling.textures.Texture = undefined):starling.textures.Texture { return null; }
	/**
	 *  Caches the filter output into a texture.
	 *      *
	 *      *  <p>An uncached filter is rendered every frame (except if it can be rendered from the
	 *      *  global render cache, which happens if the target object does not change its appearance
	 *      *  or location relative to the stage). A cached filter is only rendered once; the output
	 *      *  stays unchanged until you call <code>cache</code> again or change the filter settings.
	 *      *  </p>
	 *      *
	 *      *  <p>Beware: you cannot cache filters on 3D objects; if the object the filter is attached
	 *      *  to is a Sprite3D or has a Sprite3D as (grand-) parent, the request will be silently
	 *      *  ignored. However, you <em>can</em> cache a 2D object that has 3D children!</p>
	 *      
	 */
	public function cache():void {}
	/**
	 *  Clears the cached output of the filter. After calling this method, the filter will be
	 *      *  processed once per frame again. 
	 */
	public function clearCache():void {}
	/**
	 *  @private 
	 */
	override public function addEventListener(type:String, listener:Function):void {}
	/**
	 *  @private 
	 */
	override public function removeEventListener(type:String, listener:Function):void {}
	/**
	 *  Indicates the number of rendering passes required for this filter.
	 *      *  Subclasses must override this method if the number of passes is not <code>1</code>. 
	 */
	public function get numPasses():int { return 0; }
	/**
	 *  Padding can extend the size of the filter texture in all directions.
	 *      *  That's useful when the filter "grows" the bounds of the object in any direction. 
	 */
	public function get padding():starling.utils.Padding { return null; }
	public function set padding(value:starling.utils.Padding):void {}
	/**
	 *  Indicates if the filter is cached (via the <code>cache</code> method). 
	 */
	public function get isCached():Boolean { return false; }
	/**
	 *  The resolution of the filter texture. "1" means stage resolution, "0.5" half the stage
	 *      *  resolution. A lower resolution saves memory and execution time, but results in a lower
	 *      *  output quality. Values greater than 1 are allowed; such values might make sense for a
	 *      *  cached filter when it is scaled up. @default 1
	 *      
	 */
	public function get resolution():Number { return 0; }
	public function set resolution(value:Number):void {}
	/**
	 *  The anti-aliasing level. This is only used for rendering the target object
	 *      *  into a texture, not for the filter passes. 0 - none, 4 - maximum. @default 0 
	 */
	public function get antiAliasing():int { return 0; }
	public function set antiAliasing(value:int):void {}
	/**
	 *  The smoothing mode of the filter texture. @default bilinear 
	 */
	public function get textureSmoothing():String { return null; }
	public function set textureSmoothing(value:String):void {}
	/**
	 *  The format of the filter texture. @default BGRA 
	 */
	public function get textureFormat():String { return null; }
	public function set textureFormat(value:String):void {}
	/**
	 *  Indicates if the last filter pass is always drawn directly to the back buffer.
	 *      *
	 *      *  <p>Per default, the filter tries to automatically render in a smart way: objects that
	 *      *  are currently moving are rendered to the back buffer, objects that are static are
	 *      *  rendered into a texture first, which allows the filter to be drawn directly from the
	 *      *  render cache in the next frame (in case the object remains static).</p>
	 *      *
	 *      *  <p>However, this fails when filters are added to an object that does not support the
	 *      *  render cache, or to a container with such a child (e.g. a Sprite3D object or a masked
	 *      *  display object). In such a case, enable this property for maximum performance.</p>
	 *      *
	 *      *  @default false
	 *      
	 */
	public function get alwaysDrawToBackBuffer():Boolean { return false; }
	public function set alwaysDrawToBackBuffer(value:Boolean):void {}
}
}
