How do bevel effects work?

Hello,
I am looking to add a bevel effect(like in photoshop) to an RGBA image programatically.
I have searched far and wide in order to create this effect but I couldn’t find anything useful.

I found different talks about embossing and bump maps but I couldn’t find anything that involves a light point and that is round.

Could you help me out or atleast point me in the right direction?

Thank you.

Please delete this topic, I already got my answer on:
dsp.stackexchange.com/questions/530/bitmap-alpha-bevel-algorithm