[web] Convolution filter divisor? (flash)

Started by
1 comment, last by Funkymunky 17 years, 5 months ago
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?
Advertisement
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.

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)

This topic is closed to new replies.

Advertisement