You first need to record the equivalent flux. (I've had previous debates about this
)
Also depends if you want colour...
Bayer matrix chips do this with one shot. It takes three (filtered) shots to do the same with a monochrome CCD.
You might want to look here as a start.....
http://www.atscope.com.au/BRO/tutorials/dslr.html