I'm trying to implement some effects in C++ for my user interface controls. I've figured out that Photoshop Layer Styles uses an anti-aliased form of the Euclidean Distance Transform for "Precise" techniques (Inner Glow and Outer Glow).
But what is the method used for the "Softer" technique for Outer Glow and Inner Glow? It seems this is also used for the "Smooth" technique when computing the height map for Bevel and Emboss.
Any pointers would be appreciated!
Don't be shy folks!
Wow, thanks for all the help people. After a lot of pulling of hair and some collaboration, I finally figured it out:
1) Do some bookkeeping on the areas which will require compositing, based on the shadow offset, morphological enlargement, and clipping to the destination.
2) Dilate grayscale mask using a Chamfer 5,7,11 metric (the original algorithm from G. Borgefors is suitable). Output as 8 bit fixed point.
3) Apply box blur.
4) Apply the contour curve 1 to 1 function, converting to 8-bit alpha values in the range 0-255.
5) Fill the destination image using the drop shadow color, calculated 8-bit alpha channel, blending mode, and effect opacity.
Thanks for nothing!