C
/*
* creates a new ColormatrixFilter
* Matrix has to be 5 x 4
* [r0 ... r4]
* [g0 ... g4]
* [b0 ... b4]
* [a0 ... a4]
*/
SWFFilter
newColorMatrixFilter(SWFFilterMatrix matrix /* matrix */)
/*
* create a new FilterMatrix (constructor)
* This function creates a new SFWFilterMatrix. Only useful
* for creating SWFFilter objects.
*/
SWFFilterMatrix
newSWFFilterMatrix(int cols /* number of cols */,
int rows /* number of rows */,
float *vals /* vals[cols * rows]. Will be copied */)
Example
SWFFilterMatrix cmf;
SWFFilter filter;
/* ... */
float tab[SIZE] = {0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
cmf = newSWFFilterMatrix(5, 4, tab);
filter = newColorMatrixFilter(cmf);
/* ... */
// attach filter to DisplayItem
// display item must be a MovieClip, Button or TextField instance
SWFDisplayItem_addFilter(item, f);
/* ... */
PHP
<?
// ...
$cm = Array();
for($i = 0; $i < 20; $i++)
$cm[$i] = 0.1;
$cmf = new SWFFilterMatrix(5, 4, $cm);
$filter = new SWFFilter(SWFFILTER_TYPE_COLORMATRIX, $cmf);
/* ... */
?>