| 패키지 | spark.filters |
| 클래스 | public class DisplacementMapFilter |
| 상속 | DisplacementMapFilter BaseFilter EventDispatcher Object |
| 구현 | IBitmapFilter |
| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
The use of filters depends on the object to which you apply the filter:
- To apply filters to a display object, use the
filtersproperty of the display object. Setting thefiltersproperty of an object does not modify the object, and you can remove the filter by clearing thefiltersproperty. - To apply filters to BitmapData objects, use the
BitmapData.applyFilter()method. CallingapplyFilter()on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image.
If you apply a filter to a display object, the value of the cacheAsBitmap property of the
display object is set to true. If you clear all filters, the original value of
cacheAsBitmap is restored.
The filter uses the following formula:
dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) * scaleX) / 256, y + ((componentY(x, y) - 128) *scaleY) / 256)
where componentX(x, y) gets the componentX property color value
from the mapBitmap property at (x - mapPoint.x ,y - mapPoint.y).
The map image used by the filter is scaled to match the Stage scaling. It is not scaled when the object itself is scaled.
This filter supports Stage scaling. However, general scaling, rotation, and
skewing are not supported. If the object itself is scaled (if the scaleX
and scaleY properties are set to a value other than 1.0),
the filter effect is not scaled. It is scaled only when the user zooms in on the Stage.
MXML 구문 숨기기The <s:DisplacementMapFilter> tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:DisplacementMapFilter Properties alpha="0" color="0x000000" componentX="0" componentY="0" mapBitmap="null" mapPoint="null" mode="wrap" scaleX="0" scaleY="0" />
관련 API 요소
flash.display.DisplayObject.filters
flash.display.DisplayObject.cacheAsBitmap
| 속성 | 정의 주체 | ||
|---|---|---|---|
| alpha : Number
Specifies the alpha transparency value to use for out-of-bounds
displacements. | DisplacementMapFilter | ||
| color : uint
Specifies what color to use for out-of-bounds displacements. | DisplacementMapFilter | ||
| componentX : uint
Describes which color channel to use in the map image to displace the x result. | DisplacementMapFilter | ||
| componentY : uint
Describes which color channel to use in the map image to displace the y result. | DisplacementMapFilter | ||
![]() | constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | |
| mapBitmap : BitmapData
A BitmapData object containing the displacement map data. | DisplacementMapFilter | ||
| mapPoint : Point
A value that contains the offset of the upper-left corner of the target display
object from the upper-left corner of the map image. | DisplacementMapFilter | ||
| mode : String
The mode for the filter. | DisplacementMapFilter | ||
| scaleX : Number
The multiplier to use to scale the x displacement result from the map calculation. | DisplacementMapFilter | ||
| scaleY : Number
The multiplier to use to scale the y displacement result from the map calculation. | DisplacementMapFilter | ||
| 메서드 | 정의 주체 | ||
|---|---|---|---|
DisplacementMapFilter(mapBitmap:BitmapData = null, mapPoint:Point = null, componentX:uint = 0, componentY:uint = 0, scaleX:Number = 0.0, scaleY:Number = 0.0, mode:String = "wrap", color:uint = 0, alpha:Number = 0.0)
Constructor. | DisplacementMapFilter | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | |
Returns a copy of this filter object. | DisplacementMapFilter | ||
![]() |
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | |
![]() |
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | |
![]() |
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | |
![]() |
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | |
![]() |
Propagates a change event when the filter has changed. | BaseFilter | |
![]() |
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | |
![]() |
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | |
![]() |
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | |
![]() |
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 프리미티브 값을 반환합니다. | Object | |
![]() |
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | |
alpha | 속성 |
alpha:Number| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Specifies the alpha transparency value to use for out-of-bounds displacements. It is specified as a normalized value from 0.0 to 1.0. For example, .25 sets a transparency value of 25%. The default value is 0. Use this property if the mode property is set to DisplacementMapFilterMode.COLOR.
기본값: 0.
구현
public function get alpha():Number public function set alpha(value:Number):voidcolor | 속성 |
color:uint| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Specifies what color to use for out-of-bounds displacements. The valid range of displacements is 0.0 to 1.0. Values are in hexadecimal format. The default value for color is 0. Use this property if the mode property is set to DisplacementMapFilterMode.COLOR.
기본값: 0x000000.
구현
public function get color():uint public function set color(value:uint):voidcomponentX | 속성 |
componentX:uint| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Describes which color channel to use in the map image to displace the x result. Possible values are BitmapDataChannel constants:
BitmapDataChannel.ALPHABitmapDataChannel.BLUEBitmapDataChannel.GREENBitmapDataChannel.RED
기본값: 0, meaning no channel..
구현
public function get componentX():uint public function set componentX(value:uint):void관련 API 요소
componentY | 속성 |
componentY:uint| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Describes which color channel to use in the map image to displace the y result. Possible values are BitmapDataChannel constants:
BitmapDataChannel.ALPHABitmapDataChannel.BLUEBitmapDataChannel.GREENBitmapDataChannel.RED
기본값: 0, meaning no channel..
구현
public function get componentY():uint public function set componentY(value:uint):voidmapBitmap | 속성 |
mapBitmap:BitmapData| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
A BitmapData object containing the displacement map data.
기본값: null.
구현
public function get mapBitmap():BitmapData public function set mapBitmap(value:BitmapData):voidmapPoint | 속성 |
mapPoint:Point| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
기본값: null.
구현
public function get mapPoint():Point public function set mapPoint(value:Point):voidmode | 속성 |
mode:String| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
The mode for the filter. Possible values are DisplacementMapFilterMode constants:
DisplacementMapFilterMode.WRAP- Wraps the displacement value to the other side of the source image.DisplacementMapFilterMode.CLAMP- Clamps the displacement value to the edge of the source image.DisplacementMapFilterMode.IGNORE- If the displacement value is out of range, ignores the displacement and uses the source pixel.DisplacementMapFilterMode.COLOR- If the displacement value is outside the image, substitutes the values in the color and alpha properties.
기본값: DisplacementMapFilterMode.WRAP.
구현
public function get mode():String public function set mode(value:String):voidscaleX | 속성 |
scaleY | 속성 |
DisplacementMapFilter | () | 생성자 |
public function DisplacementMapFilter(mapBitmap:BitmapData = null, mapPoint:Point = null, componentX:uint = 0, componentY:uint = 0, scaleX:Number = 0.0, scaleY:Number = 0.0, mode:String = "wrap", color:uint = 0, alpha:Number = 0.0)| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Constructor.
매개 변수mapBitmap:BitmapData (default = null) — A BitmapData object containing the displacement map data.
| |
mapPoint:Point (default = null) — A value that contains the offset of the upper-left corner of the
target display object from the upper-left corner of the map image.
| |
componentX:uint (default = 0) — Describes which color channel to use in the map image to displace the x result.
Possible values are the BitmapDataChannel constants.
| |
componentY:uint (default = 0) — Describes which color channel to use in the map image to displace the y result.
Possible values are the BitmapDataChannel constants.
| |
scaleX:Number (default = 0.0) — The multiplier to use to scale the x displacement result from the map calculation.
| |
scaleY:Number (default = 0.0) — The multiplier to use to scale the y displacement result from the map calculation.
| |
mode:String (default = "wrap") — The mode of the filter. Possible values are the DisplacementMapFilterMode
constants.
| |
color:uint (default = 0) — Specifies the color to use for out-of-bounds displacements. The valid range of
displacements is 0.0 to 1.0. Use this parameter if mode is set to DisplacementMapFilterMode.COLOR.
| |
alpha:Number (default = 0.0) — Specifies what alpha value to use for out-of-bounds displacements.
It is specified as a normalized value from 0.0 to 1.0. For example,
.25 sets a transparency value of 25%.
Use this parameter if mode is set to DisplacementMapFilterMode.COLOR.
|
관련 API 요소
clone | () | 메서드 |
public function clone():BitmapFilter| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | Flex 4 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Returns a copy of this filter object.
반환값BitmapFilter — A new DisplacementMapFilter instance with all the same properties as the
original one.
|
Tue Jun 12 2018, 03:17 PM Z
MXML 구문 표시