Modeling the Imaging Chain of Digital Cameras