Sign in to follow this  
Funkymunky

[web] Convolution filter divisor? (flash)

Recommended Posts

Funkymunky    1413
Hi I have a question about a convolution filter that I'm applying in actionscript. Right now it's a basic blur filter, ie: 1, 0, 1, 0, 1, 0, 1, 0, 1 Every frame I draw a rectangle with a BitmapData called "pattern". I call pattern.applyFilter to apply the convolution filter to it, then do a basic bitmap fill and draw the rectangle. My question has to do with the divisor used in the construction of the convolution filter. The default is supposed to be 1, but if i set the divisor to 1 it results in a solid color filling the rectangle. If I use 0 (which is supposed to be ignored and replaced with the default) I get the same solid color. If I omit the divisor, it works properly as a blur filter... So wtf? Why can't I set the divisor to the default value and get the same result?

Share this post


Link to post
Share on other sites
Tesseract    285
This answer may be totally missing the point and useless, but here goes:

Dividing any number by 1 will give you the original number.

Dividing any number by 0 will give you a result of infinity, which defaults to NaN or some such thing.

I would imagine matrix multiplication works similarly.

Share this post


Link to post
Share on other sites
Funkymunky    1413
What I'm saying is that the default divisor is 1, but I get a different result if I manually set the divisor as 1 (or as 0, which causes the function to use the default anyway according to the documentation)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this