| パッケージ | spark.filters |
| クラス | public class ColorMatrixFilter |
| 継承 | ColorMatrixFilter BaseFilter EventDispatcher Object |
| 実装 | IBitmapFilter |
| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
MXML シンタックスを隠すThe <s:ColorMatrixFilter> tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ColorMatrixFilter
Properties
matrix="[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]"
/>
さらに例を参照
関連する API エレメント
パブリックプロパティ
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | |
| matrix : Object
レンダリングされたエレメントに適用される 4 × 5 マトリックスを構成する 20 個の倍精度実数のカンマ区切りリストです。 | ColorMatrixFilter | ||
パブリックメソッド
| メソッド | 定義元 | ||
|---|---|---|---|
ColorMatrixFilter(matrix:Array = null)
コンストラクターです。 | ColorMatrixFilter | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
イベントリスナーオブジェクトを EventDispatcher オブジェクトに登録し、リスナーがイベントの通知を受け取るようにします。 | EventDispatcher | |
このフィルターオブジェクトのコピーを返します。 | ColorMatrixFilter | ||
![]() |
イベントをイベントフローに送出します。 | EventDispatcher | |
![]() |
EventDispatcher オブジェクトに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。 | EventDispatcher | |
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
![]() |
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
フィルターの変更時に変更イベントを伝播します。 | BaseFilter | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
![]() |
EventDispatcher オブジェクトからリスナーを削除します。 | EventDispatcher | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
![]() |
指定されたイベントタイプについて、この EventDispatcher オブジェクトまたはその祖先にイベントリスナーが登録されているかどうかを確認します。 | EventDispatcher | |
パブリック定数
プロパティの詳細
matrix | プロパティ |
matrix:Object| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
レンダリングされたエレメントに適用される 4 × 5 マトリックスを構成する 20 個の倍精度実数のカンマ区切りリストです。マトリックスは行優先順です。つまり、最初の 5 つのエレメントにベクター [srcR,srcG,srcB,srcA,1] を乗算して出力の赤の値を決定し、次の 5 つが出力の緑の値を決定する、のようになります。
値は、配列、または 20 個の数字のカンマ区切りのストリングである必要があります。
デフォルト値: [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]。
実装
public function get matrix():Object public function set matrix(value:Object):voidコンストラクターの詳細
ColorMatrixFilter | () | コンストラクター |
メソッドの詳細
clone | () | メソッド |
public function clone():BitmapFilter| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
このフィルターオブジェクトのコピーを返します。
戻り値BitmapFilter — 元のインスタンスと同じプロパティをすべて備えた新しい ColorMatrixFilter インスタンスです。
|
例 この例の使用方法
ColorMatrixFilterExample.mxml
<?xml version="1.0"?>
<!-- filters/examples/ColorMatrixFilterExample .mxml -->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="createFilters()">
<fx:Script><![CDATA[
import spark.filters.*;
import flash.filters.BitmapFilterQuality;
import flash.filters.BitmapFilterType;
private var myGreenMatrixFilter:ColorMatrixFilter;
private var myBlueMatrixFilter:ColorMatrixFilter;
private var myRedMatrixFilter:ColorMatrixFilter;
public function createFilters():void {
var greenMatrix:Array = new Array();
greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // red
greenMatrix = greenMatrix.concat([0, 1, 0, 0, 0]); // green
greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // blue
greenMatrix = greenMatrix.concat([0, 0, 0, 1, 0]); // alpha
var blueMatrix:Array = new Array();
blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // red
blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // green
blueMatrix = blueMatrix.concat([0, 0, 1, 0, 0]); // blue
blueMatrix = blueMatrix.concat([0, 0, 0, 1, 0]); // alpha
var redMatrix:Array = new Array();
redMatrix = redMatrix.concat([1, 0, 0, 0, 0]); // red
redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // green
redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // blue
redMatrix = redMatrix.concat([0, 0, 0, 1, 0]); // alpha
myGreenMatrixFilter = new ColorMatrixFilter(greenMatrix);
myBlueMatrixFilter = new ColorMatrixFilter(blueMatrix);
myRedMatrixFilter = new ColorMatrixFilter(redMatrix);
greenImage.filters = [myGreenMatrixFilter];
blueImage.filters = [myBlueMatrixFilter];
redImage.filters = [myRedMatrixFilter];
}
]]></fx:Script>
<s:VGroup>
<s:VGroup>
<s:Label text="Original Image"/>
<mx:Image id="originalImage" source="@Embed(source='assets/Nokia_6630.png')"/>
</s:VGroup>
<s:VGroup>
<s:Label text="Green Matrix Image"/>
<mx:Image id="greenImage" source="@Embed(source='assets/Nokia_6630.png')"/>
</s:VGroup>
<s:VGroup>
<s:Label text="Blue Matrix Image"/>
<mx:Image id="blueImage" source="@Embed(source='assets/Nokia_6630.png')"/>
</s:VGroup>
<s:VGroup>
<s:Label text="Red Matrix Image"/>
<mx:Image id="redImage" source="@Embed(source='assets/Nokia_6630.png')"/>
</s:VGroup>
</s:VGroup>
</s:Application>
Tue Jun 12 2018, 10:34 AM Z
MXML シンタックスを表示