패키지 | spark.filters |
클래스 | public dynamic class ShaderFilter |
상속 | ShaderFilter ![]() |
구현 | IBitmapFilter, IEventDispatcher |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The ShaderFilter class must be initialized with either an instance of a Shader object or Class representative of a Shader (such as from an Embed). The ShaderFilter class then serves as a proxy to the underlying Shader, providing a convenience mechanism for accessing both scalar and multi-dimensional shader input parameters directly as simple named properties.
To set a simple scalar shader input parameter, such as of type FLOAT or INT, you can
refer to the property directly, for example, myFilter.radius
.
To set or animate an individual component of a multidimensional shader input parameter, such as
FLOAT2, you can use a property suffix convention to access the individual value directly.
The following code shows two ways to set the first and second components of the FLOAT2
property center
:
// 'center' is an input parameter of type FLOAT2.
shader.center = [10,20];
// Use property suffix convention to access the first and second component of 'center'.
shader.center_x = 10;
shader.center_y = 20;
The full set of supported property suffixes that you can use are as follows:
- For shader input parameters of type BOOL2, BOOL3, BOOL4, FLOAT2, FLOAT3, FLOAT4, INT2, INT3, or INT4, you can use "r g b a", "x y z w", or "s t p q" to access the 1st, 2nd, 3rd and 4th component, respectively.
- For shader input parameters of type MATRIX2x2, MATRIX3x3, or MATRIX4x4, you can use "a b c d e f g h i j k l m n o p" to access the 1st - 16th component of a given matrix, respectively.
As properties on the ShaderFilter change (such as during animation), the ShaderFilter automatically reapplies itself to the filters array of the visual component it is applied to.
MXML 구문
The <s:ShaderFilter>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ShaderFilter Properties bottomExtension="0" leftExtension="0" precisionHint="full" rightExtension="0" shader="[]" topExtension="0" />
관련 API 요소
속성 | 정의 주체 | ||
---|---|---|---|
bottomExtension : int
대상 객체 아래쪽의 픽셀이 늘어난 것입니다. | ShaderFilter | ||
leftExtension : int
대상 객체 왼쪽의 픽셀이 늘어난 것입니다. | ShaderFilter | ||
precisionHint : String
The precision of math operations performed by the underlying shader. | ShaderFilter | ||
rightExtension : int
대상 객체 오른쪽의 픽셀이 늘어난 것입니다. | ShaderFilter | ||
shader : Shader
A flash.display.Shader instance. | ShaderFilter | ||
topExtension : int
대상 객체 위쪽의 픽셀이 늘어난 것입니다. | ShaderFilter |
메서드 | 정의 주체 | ||
---|---|---|---|
ShaderFilter(shader:Object = null)
Constructor. | ShaderFilter |
bottomExtension | 속성 |
bottomExtension:int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
대상 객체 아래쪽의 픽셀이 늘어난 것입니다.
늘어났다는 것은 실행 도중 셰이더에 전달된 대상 객체의 경계를 넘어간 영역을 말합니다. 실행 중에 Flash Player 또는 AIR는 동영상 클립의 일반 경계를 계산하고 leftExtension
, rightExtension
, topExtension
및 bottomExtension
값에 따라 경계를 확장합니다.
기본값: 0.
구현
public function get bottomExtension():int
public function set bottomExtension(value:int):void
leftExtension | 속성 |
leftExtension:int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
대상 객체 왼쪽의 픽셀이 늘어난 것입니다.
늘어났다는 것은 실행 도중 셰이더에 전달된 대상 객체의 경계를 넘어간 영역을 말합니다. 실행 중에 Flash Player 또는 AIR는 동영상 클립의 일반 경계를 계산하고 leftExtension
, rightExtension
, topExtension
및 bottomExtension
값에 따라 경계를 확장합니다.
기본값: 0.
구현
public function get leftExtension():int
public function set leftExtension(value:int):void
precisionHint | 속성 |
precisionHint:String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The precision of math operations performed by the underlying shader. The set of possible values for the precisionHint property is defined by the constants in the ShaderPrecision class.
기본값: ShaderPrecision.FULL.
구현
public function get precisionHint():String
public function set precisionHint(value:String):void
관련 API 요소
rightExtension | 속성 |
rightExtension:int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
대상 객체 오른쪽의 픽셀이 늘어난 것입니다.
늘어났다는 것은 실행 도중 셰이더에 전달된 대상 객체의 경계를 넘어간 영역을 말합니다. 실행 중에 Flash Player 또는 AIR는 동영상 클립의 일반 경계를 계산하고 leftExtension
, rightExtension
, topExtension
및 bottomExtension
값에 따라 경계를 확장합니다.
기본값: 0.
구현
public function get rightExtension():int
public function set rightExtension(value:int):void
shader | 속성 |
topExtension | 속성 |
topExtension:int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
대상 객체 위쪽의 픽셀이 늘어난 것입니다.
늘어났다는 것은 실행 도중 셰이더에 전달된 대상 객체의 경계를 넘어간 영역을 말합니다. 실행 중에 Flash Player 또는 AIR는 동영상 클립의 일반 경계를 계산하고 leftExtension
, rightExtension
, topExtension
및 bottomExtension
값에 따라 경계를 확장합니다.
기본값: 0.
구현
public function get topExtension():int
public function set topExtension(value:int):void
ShaderFilter | () | 생성자 |
<?xml version="1.0"?> <s:Application xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009"> <!-- The hypothetical 'spherize' shader applied below has two input parameters, 'center' and 'radius' with the following attributes: parameter 'center' ==< type: float2 minValue: float2(-200,-200) maxValue: float2(800,500) defaultValue: float2(400,250) description: "displacement center" parameter 'radius' ==< type: float minValue: float(.1) maxValue: float(400) defaultValue: float(200) description: "radius" --> <s:Label text="ABCDEF"> <s:filters> <s:ShaderFilter shader="@Embed(source='shaders/spherize.pbj')" radius="25" center_x="50" center_y="15" /> </s:filters> </s:Label> </s:Application>
Tue Jun 12 2018, 03:17 PM Z