change the monitor brightness

view story

http://www.linuxquestions.org – Hi I wanna write a c program which reduces the monitor brightness(monitor screen has to become dim). So I want to know is there any command or api to dim the monitor. Please dont suggest xgamma -gamma "value". because it does not make the monitor dim. just it reduces RGB values. And that API or command must work for lcd, CRT, Laptop monitors. Thanks (HowTos)