1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.senocular.gyro {
import flash.filters.ColorMatrixFilter;
public class InterpolateColorMatrixFilter extends AbstractInterpolateFilter {
public var target:ColorMatrixFilter;
public var start:ColorMatrixFilter;
public var end:ColorMatrixFilter;
public function InterpolateColorMatrixFilter(target:ColorMatrixFilter, start:ColorMatrixFilter = null, end:ColorMatrixFilter = null, owner:* = null, property:Object = null){
this.target = target;
this.start = (start) ? start : this.target;
this.end = (end) ? end : this.start;
super(owner, property);
}
public override function interpolate(t:Number):void {
var matrix:Array = new Array(count);
for (var i:int = 0; i<20; i++){
matrix[i] = start.matrix[i] + (end.matrix[i] - start.matrix[i])*t;
}
target.matrix = matrix;
assign(target);
}
}
}