package starling.filters {
import starling.textures.Texture;
import starling.rendering.Painter;
/**
 *  The DisplacementMapFilter class uses the pixel values from the specified texture (called
 *  *  the map texture) to perform a displacement of an object. You can use this filter
 *  *  to apply a warped or mottled effect to any object that inherits from the DisplayObject
 *  *  class.
 *  *
 *  *  <p>The filter uses the following formula:</p>
 *  *  <listing>dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) &#42; scaleX) / 256,
 *  *                      y + ((componentY(x, y) - 128) &#42; scaleY) / 256]
 *  *  </listing>
 *  *
 *  *  <p>Where <code>componentX(x, y)</code> gets the componentX property color value from the
 *  *  map texture at <code>(x - mapX, y - mapY)</code>.</p>
 *  *
 *  *  <strong>Clamping to the Edges</strong>
 *  *
 *  *  <p>Per default, the filter allows the object to grow beyond its actual bounds to make
 *  *  room for the displacement (depending on <code>scaleX/Y</code>). If you want to clamp the
 *  *  displacement to the actual object bounds, set all margins to zero via a call to
 *  *  <code>filter.padding.setTo()</code>. This works only with rectangular, stage-aligned
 *  *  objects, though.</p>
 *  
 * @externs
 */
public class DisplacementMapFilter extends starling.filters.FragmentFilter {
	/**
	 *  Creates a new displacement map filter that uses the provided map texture.
	 *      *
	 *      * @param mapTexture  The texture containing the displacement map data.
	 *      * @param componentX  Describes which color channel to use in the map image to displace
	 *      *                    the x result. Possible values are the BitmapDataChannel constants.
	 *      * @param componentY  Describes which color channel to use in the map image to displace
	 *      *                    the y result. Possible values are the BitmapDataChannel constants.
	 *      * @param scaleX      The multiplier used to scale the x displacement result.
	 *      * @param scaleY      The multiplier used to scale the y displacement result.
	 *      
	 */
	public function DisplacementMapFilter(mapTexture:starling.textures.Texture, componentX:int = undefined, componentY:int = undefined, scaleX:Number = undefined, scaleY:Number = undefined) {
		super();
	}
	/**
	 *  @private 
	 */
	override public function process(painter:starling.rendering.Painter, pool: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; }
	/**
	 *  Describes which color channel to use in the map image to displace the x result.
	 *      *  Possible values are constants from the BitmapDataChannel class. 
	 */
	public function get componentX():int { return 0; }
	public function set componentX(value:int):void {}
	/**
	 *  Describes which color channel to use in the map image to displace the y result.
	 *      *  Possible values are constants from the BitmapDataChannel class. 
	 */
	public function get componentY():int { return 0; }
	public function set componentY(value:int):void {}
	/**
	 *  The multiplier used to scale the x displacement result from the map calculation. 
	 */
	public function get scaleX():Number { return 0; }
	public function set scaleX(value:Number):void {}
	/**
	 *  The multiplier used to scale the y displacement result from the map calculation. 
	 */
	public function get scaleY():Number { return 0; }
	public function set scaleY(value:Number):void {}
	/**
	 *  The horizontal offset of the map texture relative to the origin. @default 0 
	 */
	public function get mapX():Number { return 0; }
	public function set mapX(value:Number):void {}
	/**
	 *  The vertical offset of the map texture relative to the origin. @default 0 
	 */
	public function get mapY():Number { return 0; }
	public function set mapY(value:Number):void {}
	/**
	 *  The horizontal scale applied to the map texture. @default 1 
	 */
	public function get mapScaleX():Number { return 0; }
	public function set mapScaleX(value:Number):void {}
	/**
	 *  The vertical scale applied to the map texture. @default 1 
	 */
	public function get mapScaleY():Number { return 0; }
	public function set mapScaleY(value:Number):void {}
	/**
	 *  The texture that will be used to calculate displacement. 
	 */
	public function get mapTexture():starling.textures.Texture { return null; }
	public function set mapTexture(value:starling.textures.Texture):void {}
	/**
	 *  Indicates if pixels at the edge of the map texture will be repeated.
	 *      *  Note that this only works if the map texture is a power-of-two texture!
	 *      
	 */
	public function get mapRepeat():Boolean { return false; }
	public function set mapRepeat(value:Boolean):void {}
	public function get dispEffect():starling.filters.DisplacementMapEffect { return null; }
}
}
