03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The use of filters depends on the object to which you apply the filter:<br />

■ To apply filters to movie clips at runtime, use the filters property. Setting the filters<br />

property of an object does not modify the object <strong>and</strong> can be undone by clearing the<br />

filters property.<br />

■ To apply filters to BitmapData instances, use the BitmapData.applyFilter() method.<br />

Calling applyFilter() on a BitmapData object takes the source BitmapData object <strong>and</strong><br />

the filter object <strong>and</strong> generates a filtered image as a result.<br />

You can also apply filter effects to images <strong>and</strong> video at authoring time. For more information,<br />

see your authoring documentation.<br />

If you apply a filter to a movie clip or button, the cacheAsBitmap property of the movie clip<br />

or button is set to true. If you clear all filters, the original value of cacheAsBitmap is<br />

restored.<br />

A matrix convolution is based on an n x m matrix, which describes how a given pixel value in<br />

the input image is combined with its neighboring pixel values to produce a resulting pixel<br />

value. Each result pixel is determined by applying the matrix to the corresponding source pixel<br />

<strong>and</strong> its neighboring pixels.<br />

For a 3 x 3 matrix convolution, the following formula is used for each independent color<br />

channel:<br />

dst (x, y) = ((src (x-1, y-1) * a0 + src(x, y-1) * a1....<br />

src(x, y+1) * a7 + src (x+1,y+1) * a8) / divisor) + bias<br />

When run by a processor that offers SSE (Streaming SIMD Extensions), certain filter<br />

specifications perform faster.<br />

■ The filter must be a 3 x 3 filter.<br />

■ All the filter terms must be integers between -127 <strong>and</strong> +127.<br />

■ The sum of all the filter terms must not have an absolute value greater than 127.<br />

■ If any filter term is negative, the divisor must be between <strong>2.0</strong>0001 <strong>and</strong> 256.<br />

■ If all filter terms are positive, the divisor must be between 1.1 <strong>and</strong> 256.<br />

■ The bias must be an integer.<br />

A filter is not applied if the resulting image would exceed 2880 pixels in width or height. For<br />

example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the<br />

resulting image reaches the 2880-pixel limit.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

ConvolutionFilter (flash.filters.ConvolutionFilter) 463

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!